Heap Overflow Vulnerability in SQLite

sqlite Updated 02 Oct 2025

Summary

27/06/2020
N/A
Yes i
Medium
5.5

CVE-2020-15358: In SQLite before 3.32.3, select.c mishandles query-flattener optimization, leading to a multiSelectOrderBy heap overflow because of misuse of transitive properties for constant propagation. Affects sqlite across 2 version ranges.

< 3.32.1-r1 < ee3686eb50c0e3dbb087c9a0976f7e37e1b014ae

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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

SQLite is a popular open-source relational database management system that is widely used in various applications. It provides a lightweight, self-contained, and serverless database engine. The vulnerability, identified as CVE-2020-15358, affects SQLite versions before 3.32.3. This vulnerability arises due to a flaw in the query-flattener optimization process in the select.c module of SQLite. The flaw allows an attacker to trigger a heap overflow by exploiting the misuse of transitive properties for constant propagation in the multiSelectOrderBy function.

Vulnerability Detail

The vulnerability in SQLite can be exploited by an attacker to execute arbitrary code or cause a denial-of-service condition. By crafting a malicious query, an attacker can trigger the heap overflow, potentially leading to remote code execution or crashing the application. The impact of this vulnerability depends on the context in which SQLite is used. If SQLite is integrated into a web application or any other system that processes untrusted input, the risk of exploitation increases significantly.

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, developers can disable the query-flattener optimization feature in SQLite. This can be achieved by setting the SQLITE_OMIT_SUBQUERY flag during the compilation process. However, this workaround may impact the performance of the application, and it is strongly recommended to apply the official patch or upgrade to the latest version as soon as possible.

Conclusion

The heap overflow vulnerability in SQLite (CVE-2020-15358) poses a significant risk to applications utilizing SQLite for data storage and processing. It is crucial to promptly update SQLite to version 3.32.3 or later to mitigate the vulnerability. Regularly checking for updates and applying patches is essential for maintaining the security of your application. For further assistance or support in 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, self-contained, and serverless database engine. It is widely used in various applications, including mobile devices, embedded systems, and web browsers.

The vulnerability allows an attacker to trigger a heap overflow in SQLite, potentially leading to remote code execution or crashing the application. The impact depends on the context in which SQLite is used and the presence of other security measures.

To fix this vulnerability, it is recommended to upgrade SQLite to version 3.32.3 or later. The SQLite project has released a patch to address this issue. Regularly checking for updates and applying patches promptly is crucial for maintaining the security of your application.

As a temporary workaround, developers can disable the query-flattener optimization feature in SQLite by setting the SQLITE_OMIT_SUBQUERY flag during compilation. However, it is strongly advised to apply the official patch or upgrade to the latest version as soon as possible.

For more information about this vulnerability, you can refer to the CVE-2020-15358 entry in the National Vulnerability Database (NVD) or visit the official SQLite website.

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