Memory Corruption Vulnerability in SQLite3 - CVE-2025-6965

sqlite Updated 02 Oct 2025

Summary

15/07/2025
N/A
Yes i
Critical
9.8

CVE-2025-6965: There exists a vulnerability in SQLite versions before 3.50.2 where the number of aggregate terms could exceed the number of columns available. Affects sqlite across 2 version ranges.

< 3.48.0-r3 < 9d7c5df7f0e42528bf514b5231d58273bea47e40

Fixed in 3.48.0-r3. 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

SQLite3 is a widely used database engine that provides a lightweight, serverless, self-contained SQL database. It is known for its simplicity and efficiency, making it a popular choice for applications ranging from mobile apps to web browsers. However, certain versions of SQLite3 are vulnerable to a memory corruption issue due to improper handling of aggregate terms, which can lead to significant security risks.

Vulnerability Detail

The vulnerability identified as CVE-2025-6965 exists in SQLite versions prior to 3.50.2. It arises from the potential for the number of aggregate terms in a query to exceed the number of available columns. This discrepancy can lead to memory corruption, which may allow an attacker to execute arbitrary code or crash the application. The issue is particularly concerning as it can compromise the integrity and confidentiality of the data managed by the database.

How To Fix

Minimum fixed version

3.48.0-r3

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, you can limit the use of aggregate functions in your SQL queries until the upgrade is completed. This may help mitigate the risk of triggering the vulnerability while you work on applying the fix.

Conclusion

CVE-2025-6965 represents a significant security risk for applications using vulnerable versions of SQLite3. It is crucial to upgrade to the patched version to protect against potential memory corruption and its associated consequences. Regular monitoring for vulnerabilities, such as through tools like Vulert, can help maintain application security.

See every vulnerability recorded for sqlite →

Share this vulnerability

FAQ

CVE-2025-6965 is a vulnerability in SQLite3 that can lead to memory corruption due to improper handling of aggregate terms.

SQLite3 versions prior to 3.50.2 are affected by this vulnerability.

Exploiting this vulnerability could allow an attacker to execute arbitrary code or crash the application, compromising data integrity and confidentiality.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Upgrade SQLite3 to version 3.50.2 or above as soon as possible to mitigate the risk associated with this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for sqlite.

How To Fix

Minimum fixed version

3.48.0-r3

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