Use-after-free vulnerability in SQLite SELECT query functionality

sqlite Updated 02 Oct 2025

Summary

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

CVE-2021-20227: A flaw was found in SQLite's SELECT query functionality (src/select.c). Affects sqlite across 2 version ranges.

< 3.32.1-r1 >= ef215fbf3b581ef4e0273bb3932fa522af88fd7e, < 60405cd15cdd085745101a29112043299d439cfa

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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

SQLite is a popular open-source relational database management system that is widely used in various applications. It provides a lightweight, embedded SQL database engine with a small memory footprint. SQLite is known for its simplicity, reliability, and wide platform support. However, a vulnerability has been discovered in the SELECT query functionality of SQLite, which can lead to a use-after-free issue.

Vulnerability Detail

The use-after-free vulnerability in SQLite's SELECT query functionality allows an attacker with local access to the SQLite database to cause a denial of service or potentially execute arbitrary code. By triggering the use-after-free, an attacker can manipulate the memory layout of the SQLite process, leading to a crash or possible code execution. This vulnerability poses a moderate threat to system availability.

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

There is no known workaround for this vulnerability. It is essential to apply the provided fix by updating the SQLite package to a patched version.

Conclusion

The use-after-free vulnerability in SQLite's SELECT query functionality can be mitigated by updating the affected SQLite package to the recommended patched versions. It is crucial to apply the fix to ensure the security and stability of the SQLite database. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for sqlite →

Share this vulnerability

FAQ

SQLite is an open-source relational database management system that provides a lightweight, embedded SQL database engine.

The vulnerability can lead to a denial of service or potential code execution if exploited by an attacker with local access to the SQLite database.

To fix this vulnerability, update the affected SQLite package to the recommended patched versions.

No, there is no known workaround for this vulnerability. Updating the SQLite package is the recommended solution.

You can find more information about this vulnerability in the provided source link.

Related vulnerabilities

Recent vulnerabilities recorded for sqlite.

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