CVE-2025-70873
vulnerability analysis and mitigation

Overview

CVE-2025-70873 is an information disclosure vulnerability in the zipfileInflate function of SQLite's zipfile extension, affecting SQLite v3.51.1 and all earlier versions. A logic flaw causes the function to return a BLOB containing uninitialized heap memory when processing a crafted ZIP file with a mismatched szUncompressed value. The vulnerability was reported on 2025-12-06, with a fixed version released on 2026-01-09, and publicly disclosed on 2026-03-12. It carries a CVSS v3.1 base score of 7.5 (High) (Red Hat Advisory, PoC Gist).

Technical details

The root cause is classified as CWE-908 (Use of Uninitialized Resource) and CWE-244 (Improper Clearing of Heap Memory Before Release). In zipfileInflate() within sqlite/ext/misc/zipfile.c, the output buffer aRes is allocated via sqlite3_malloc(nOut) where nOut is the untrusted szUncompressed value from the ZIP Central Directory Structure. After calling inflate() to decompress data, the function passes nOut as the BLOB size to sqlite3_result_blob() rather than computing the actual inflated byte count from str.avail_out. If a crafted ZIP file specifies a szUncompressed larger than the actual decompressed output, the tail of the uninitialized heap buffer is returned to the SQL layer as part of the BLOB, leaking heap contents such as memory addresses (PoC Gist, SQLite Patch).

Impact

Successful exploitation allows an attacker to obtain uninitialized heap memory contents — including heap pointers, credentials, encryption keys, or other sensitive data resident in memory — by supplying a crafted ZIP file to any application using SQLite's zipfile extension. The leaked heap addresses can be used to defeat ASLR, potentially facilitating exploitation of additional memory corruption vulnerabilities in the same process. There is no impact on integrity or availability; the vulnerability is purely a confidentiality issue (PoC Gist, Red Hat Advisory).

Exploitability

A public proof-of-concept exploit is available on GitHub, demonstrating heap memory leakage via crafted SQL and a malicious ZIP payload in the SQLite CLI. There is no evidence of in-the-wild exploitation at this time, and the vulnerability has not been added to the CISA KEV catalog. The EPSS score is approximately 0.017% (0.000170), indicating low probability of near-term exploitation. No threat actor attribution has been reported (PoC Gist, Red Hat Advisory).

Exploitation steps

  1. Identify target: Locate an application or service that uses SQLite with the zipfile extension enabled (e.g., SQLite CLI, or applications compiled with SQLITE_ENABLE_ZIPFILE), running version 3.51.1 or earlier.
  2. Craft malicious ZIP file: Construct a ZIP file where the Central Directory Structure's szUncompressed field is set to a value larger than the actual decompressed data size. The compressed payload itself is valid and will decompress successfully, but the declared uncompressed size is inflated.
  3. Submit ZIP to SQLite: Cause the target application to process the crafted ZIP via the zipfile virtual table, for example using SQL: SELECT hex(data) FROM zipfile(<crafted_zip_blob>);
  4. Trigger heap disclosure: The zipfileInflate() function allocates an uninitialized buffer of size szUncompressed, decompresses the data into it, and returns the full buffer (including uninitialized tail bytes) as a BLOB.
  5. Extract leaked data: Read the returned BLOB; bytes beyond the actual decompressed content contain raw heap memory, potentially including heap pointers, previously freed allocations, or other sensitive data.
  6. Leverage for further exploitation: Use leaked heap addresses to calculate memory layout offsets, bypassing ASLR, and use this information to assist in exploiting additional memory corruption vulnerabilities in the target process (PoC Gist).

Indicators of compromise

  • Network: Unusual or automated submission of ZIP file data (as hex blobs or file paths) to SQLite-backed services or APIs; repeated queries involving the zipfile() virtual table from unexpected sources.
  • Logs: SQL query logs containing SELECT ... FROM zipfile(...) with large or anomalous binary blob arguments; application error logs showing unexpected BLOB sizes returned from zipfile queries.
  • File System: Presence of crafted ZIP files with mismatched szUncompressed values in directories processed by SQLite-enabled applications; unexpected temporary files created during ZIP processing.
  • Process: Unusual memory access patterns or heap inspection activity in processes running SQLite with the zipfile extension; debugger or memory analysis tool artifacts (e.g., pwndbg, gdb) on systems where exploitation was tested (PoC Gist).

Mitigation and workarounds

Upgrade SQLite to a version newer than 3.51.1; the fix was committed on 2026-01-09 and is available at the official SQLite repository. The patch corrects zipfileInflate() to use the actual inflated byte count (derived from str.avail_out) rather than the untrusted szUncompressed value when setting the BLOB size. For systems that cannot be patched immediately, disable the zipfile extension if it is not required, or restrict access to SQLite instances so that untrusted ZIP files cannot be submitted for processing (SQLite Patch, Red Hat Advisory).

Community reactions

Red Hat tracked the vulnerability via Bugzilla (Bug 2447086) and assigned it a low severity/priority rating for their products. openSUSE issued security announcements addressing the issue in sqlite3 packages. The Yocto Project security mailing list also flagged the vulnerability for embedded Linux users. Community reaction has been measured, with the PoC receiving minimal engagement (0 stars on GitHub), consistent with the low EPSS score and absence of active exploitation (Red Hat Bugzilla, openSUSE Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

sqlite3

Affected

sid

sqlite3

Affected

trixie

sqlite3

Affected

RHEL / CentOS

Unknown

SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management