Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
HighPublic exploit

Integer truncation memory corruption in SQLite aggregate query handling

IdentifiersCVE-2025-6965CWE-197· Numeric Truncation Error

CVE-2025-6965 is a vulnerability in SQLite before 3.50.2 in aggregate query processing. According to the provided sources, the flaw is in SQLite’s handling of aggregate terms where the number of aggregate terms can exceed the number of available columns. More specifically, SQLite assigned the issue to an integer truncation problem in findOrCreateAggInfoColumn(): when aggregate processing involves a very large number of distinct column references, a 32-bit index can be truncated to a signed 16-bit value once the count exceeds 32,767. This truncation can produce negative or otherwise invalid indexes. In non-debug builds, the corrupted index may then be used for out-of-bounds array access, including heap-buffer-overflow conditions and invalid VDBE instruction construction; the provided context also notes out-of-bounds read/write behavior in agginfoPersistExprCb. The resulting condition is memory corruption. SQLite lists the issue as fixed in version 3.50.2.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can cause memory corruption in the SQLite process. The provided context indicates this may manifest as out-of-bounds reads and writes, heap-buffer-overflow, assertion failures in debug builds, process crashes, denial of service, and potentially arbitrary code execution depending on the embedding application and exploitability conditions. Several downstream advisories characterize the impact as potentially including arbitrary code execution, while the core SQLite context more conservatively establishes memory corruption with possible severe compromise.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, reduce exposure by preventing attacker-controlled SQL from reaching SQLite. In practice, eliminate SQL injection paths, avoid executing arbitrary or dynamically constructed SQL derived from untrusted input, and restrict features or workflows that allow untrusted database files or attacker-influenced aggregate queries to be processed. These are temporary risk-reduction measures only; no complete workaround is provided beyond upgrading.

Remediation

Patch, then assume compromise.

Upgrade SQLite to version 3.50.2 or later. For products that bundle or statically include SQLite, apply the vendor update that incorporates SQLite 3.50.2 or a later fixed release. The provided context references SQLite source revision 5508b56fd24016c1 as the upstream fix.
PUBLIC EXPLOITS

Exploits

No valid public exploits. Mallory filtered out 1 candidate as fakes, detection scripts, or README-only repos.

VALID 0 / 1 TOTALView more in app

All candidate exploits were filtered out by Mallory's validation.

EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
SqliteSqliteapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity46

Community discussion across Reddit, Mastodon, and other social sources.