5 ms·
That bug was fixed long ago, even before the referenced video was produced. The described attack is clever. It exploits the fact that an attacker might alter
by SQLite 6y ago
That bug was fixed long ago, even before the referenced video
was produced.
The described attack is clever. It exploits the fact that
an attacker might alter the schema so that it invokes an SQL
function with side-effects when an app simply tries to read
from a table. And depending on those side-effects, an exploit
might be possible. In the video, there was a bug in a built-in
SQL function that caused exploitable side-effects. But that bug
was fixed long before the video was even produced. The examples in the video were from an older version of SQLite. They did not work for the latest SQLite release on the day that lecture was given.
Since the checkpoint.com attack was described (in the video and elsewhere) new defense-in-depth features have been
added to SQLite to make similar exploits increasingly unlikely.
(1) Built-in SQL functions that have side effects cannot be
used in the schema. Side-effect functions can only be invoked
directly by the application.
(2) When applications register their own custom SQL functions, they can now mark those functions as "direct-only", meaning that they are prohibited in the schema.
(3) Run-time and compile-time options are available to prohibit the use of SQL functions in the schema that are not explicitly declared to be safe for use in the schema - that is, functions without side effects. This is for use in legacy applications that might have been created before the per-function flag that prohibited use within the schema was available. It is also an extra layer of defense for complex applications that might add hundreds or thousands of side-effect SQL functions - to ensure that the "direct-only" flag is not accidentally omitted from one of them.
(4) Run-time options are available to disable triggers and views in applications that do not need them. This is not necessary to avoid an exploit, but it does provide an additional layer of defense.
See https://sqlite.org/security.html https://sqlite.org/security.html and especially paragraph 1.2 item 8 for additional information.