SQLite patches use-after-free bug that left apps open to code execution, denial-of-service exploits – The Daily Swig

More than one trillion SQLite databases potentially active in myriad operating systems, browsers, and applications

UPDATED SQLite has issued a security patch after the discovery of a use-after-free bug that, if triggered, could lead to arbitrary code execution or denial of service (DoS).

The highest threat to systems running affected versions of SQLite, a C-language library that implements an SQL database engine, is to system availability, according to a Red Hat Bugzilla thread.

However, the flaw is only marked as medium severity because exploitation depends on attackers already having access to query the data in the database, noted Todd Cullum, senior product security engineer at Red Hat, an open source software vendor.

Richard Hipp, who launched the SQLite project in 2000 and remains its architect, didnt think the vulnerability posed a serious threat.

If an SQL injection bug exists on a target system then it might be possible dependent on other protections in place to cause SQLite to read a previously freed data structure and potentially cause a crash, he told The Daily Swig. More likely, it will just cause SQLite to return a goofy answer.

As a read rather than write after free bug, there are no known paths to an RCE, he added. So really, this problem allows an attacker to escalate an SQL injection vulnerability in the application into a denial of service.

But in that case, the attacker already has a more trivial denial of service by simply sending in a (well-formed) SQL statement that runs forever. So it isnt clear that this bug gives an attacker any new capabilities.

If the impact of the vulnerability is described as moderate, then surely few other applications present such an enormous attack surface.

Open source SQLite is likely used more than all other database engines combined, claims the SQLite website, which estimates the number of active SQLite databases at more than one trillion.

Catch up on the latest security vulnerability news

The relational database management system is built into all 3.5 billion active smartphones, as well as all Apple Macs and Windows 10 machines; Firefox, Chrome, and Safari web browsers; Skype, iTunes, and Dropbox; and most smart TVs, among many more applications.

Inti De Ceukelaire, head of hackers at bug bounty platform Intigriti, told The Daily Swig that the bugs moderate severity might instil a false sense of security into some vendors.

The problem with these kind of medium severity vulnerabilities is that vendors will often not consider fixing it until real-world impact is shown, he explains. This is a highly contextual vulnerability that would only work in specific situations.

Therefore, I do not expect that vendors will make breaking changes in order to mitigate this vulnerability, which could potentially lead to chained attacks of unpatched systems in the future.

Found in SQLites query functionality (), the issue arose because of a problem handling sub-queries with both a correlated clause and a clause where the parent query is itself an aggregate, according to a vulnerability alert published by Ubuntu, the Linux distribution, on February 5.

The problem was apparently introduced by a code change implemented in June 2020.

Todd Cullum of Red Hat expanded on this analysis: The clause , uses an aggregate column from the outer query.

If the term is moved into the clause in this case, SQLite would at one point optimize to simply . Which is logically correct, but happened to cause problems in aggregate processing for the outer query.

The security flaw, which affects the SQLite 3 release line, was first flagged in an SQLite bug tracker on January 19, then patched the following day in version 3.341 on January 20.

The issue (CVE-2021-20227) was resolved by adding the check to the statement before the business logic in in file , according to Cullum.

Ubuntu updated its software accordingly on February 11, while the latest versions of Red Hat Enterprise Linux 6, 7, and 8 are unaffected as they run SQLite versions that predate the commit that introduced the bug.

A security bulletin issued by AUSCert (Australias Computer Emergency Response Team), confirmed that the flaw is exploitable on Ubuntu, Windows, UNIX, Linux, and OSX operating systems.

Even though there are no known vulnerabilities due to this bug, it does come close to being an opportunity to escalate an SQLi into something more serious, so it is still good to upgrade, if only for defense-in-depth, said Richard Hipp of SQLite.

This article was updated on January 16 with comments from Richard Hipp and Inti De Ceukelaire.

YOU MAY ALSO LIKE Measuring risk: Organizations urged to choose defense-in-depth over CVE whack-a-mole

Continue reading here:

SQLite patches use-after-free bug that left apps open to code execution, denial-of-service exploits - The Daily Swig

Related Posts
This entry was posted in $1$s. Bookmark the permalink.