Submitted via IRC for AnonymousCoward
SELECT code_execution FROM * USING SQLite: Eggheads lift the lid on DB security hi-jinks
At the DEF CON hacking conference in Las Vegas on Saturday, infosec gurus from Check Point are scheduled to describe a technique for exploiting SQLite, a database used in applications across every major desktop and mobile operating system, to gain arbitrary code execution.
In a technical summary provided to The Register ahead of their presentation, Check Point's Omer Gull sets out how he and his colleague Omri Herscovici developed techniques referred to as Query Hijacking and Query Oriented Programming, in order to execute malicious code on a system. Query Oriented Programming is similar in a way to return oriented programming in that it relies on assembling malicious code from blocks of CPU instructions in a program's RAM. The difference is that QOP is done with SQL queries.
[...] It must be stressed, though, that to pull off Check Point's techniques to hack a given application via SQLite, you need file-system access permissions to alter that app's SQLite database file, and that isn't always possible. If you can change a program's database file, you can probably get, or already have achieved, code execution on the system by some other means anyway.
Nonetheless, it's a fascinating look into modern methods of code exploitation, and a neat set of discoveries.
(Score: 0) by Anonymous Coward on Tuesday August 13 2019, @07:46AM
You can share SQLite files between instances of different applications just fine. In fact, it is the preferred format for archiving databases and other relational data. In addition, it has widespread usage as various application file formats as an alternative to rolling your own or using a zip file full of other files. Not to mention both use cases are explicitly mentioned and supported in the official documentation.
Second, there are plenty of abuses that this can be leveraged to use in a single process. The most obvious being persistence across reboots, poisoning forked workers, or evading cleaning attempts. And that doesn't get into what the same user can do on many systems. Additionally, you really only need to get ACE in one process, as long as it is the right one.
Third, you could also use this to poison :memory: databases too. The barrier is much higher, but it is worth noting that not all of the methods require direct memory manipulation of the victim.