SQLite Denial of Service Vulnerability - ALPINE-CVE-2021-20227

sqlite Updated 02 Oct 2025

Summary

23/03/2021
N/A
Yes i
Medium
5.5

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for sqlite.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback