Malicious SQLite Databases Can Trigger Code Execution via Query Hijacking
Vulnerability Disclosure · 1 source · Updated 3mo ago · First seen Aug 10, 2019

Check Point Research disclosed that a crafted SQLite database can be weaponized to achieve code execution by exploiting memory-corruption flaws in the SQLite engine itself, even when an application only performs hardcoded queries against untrusted data. The researchers described two techniques—Query Hijacking and Query Oriented Programming (QOP)—that abuse schema elements such as VIEWs and virtual-table features to redirect execution into attacker-controlled paths without requiring a surrounding scripting environment.
The report demonstrated the approach in two practical scenarios: remote code execution against a PHP7-based password-stealer backend and privileged persistence on iOS by replacing a frequently queried SQLite database. The research also pointed to risky virtual-table modules including FTS and RTREE, referenced earlier issues such as CVE-2015-7036 and CVE-2019-8457, and said Apple assigned CVE-2019-8600, CVE-2019-8598, CVE-2019-8602, and CVE-2019-8577 after responsible disclosure.


