SQLite Denial of Service Vulnerability - ALPINE-CVE-2021-20227
Summary
ALPINE-CVE-2021-20227: A flaw was found in SQLite's SELECT query functionality (src/select.c). Affects sqlite versions < 3.32.1-r1. Fixed in 3.32.1-r1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
SQLite is a widely used, lightweight, serverless, self-contained SQL database engine. It is known for its simplicity and efficiency, making it a popular choice for applications that require a relational database without the overhead of a full database server. However, SQLite is vulnerable to certain types of attacks, including those that exploit flaws in its query processing capabilities.
Vulnerability Detail
A flaw was discovered in SQLite's SELECT query functionality, specifically in the source file src/select.c. This vulnerability allows an attacker with local access to the SQLite database to execute SQL queries that can lead to a denial of service or potentially arbitrary code execution through a use-after-free condition. The highest threat posed by this vulnerability is to system availability, as it can cause the database to crash or behave unpredictably.
How To Fix
Minimum fixed version
3.32.1-r1
This is the first release that contains the fix.
sudo apk add --upgrade sqlite
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, limit access to the SQLite database to trusted users only, and avoid executing untrusted SQL queries. This can help mitigate the risk of exploitation until the package is updated.
Conclusion
The SQLite vulnerability identified as ALPINE-CVE-2021-20227 poses a significant risk to applications using affected versions of the SQLite package. It is crucial to update to the patched versions to ensure system stability and security. Users should also consider using tools like Vulert to monitor for vulnerabilities in their software.
See every vulnerability recorded for sqlite →
FAQ
The CVSS score of this vulnerability is 5.5, indicating a moderate level of severity.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The potential consequences include denial of service, where the database may crash, and in some cases, it could allow for arbitrary code execution.
Yes, versions 3.32.1-r1 and later for Alpine v3.12, and 3.34.1-r0 and later for Alpine v3.14 and above are patched and safe to use.
If immediate updates are not possible, restrict access to the database and avoid executing potentially harmful SQL queries as a temporary measure.
References
Related vulnerabilities
Recent vulnerabilities recorded for sqlite.