CVE-2025-6965
vulnerability analysis and mitigation

Overview

CVE-2025-6965 is a memory corruption vulnerability in SQLite versions before 3.50.2, where the number of aggregate terms in a query can exceed the number of available columns, leading to a heap memory corruption condition. The vulnerability was discovered by Google's AI agent "Big Sleep" and disclosed on July 15, 2025, assigned by Google as the CVE Numbering Authority. It affects all SQLite versions prior to 3.50.2 and has a CVSS v3.1 base score of 9.8 (Critical), reflecting its network-exploitable, no-authentication-required nature (Red Hat Advisory, Apple iOS Advisory).

Technical details

The root cause is classified as CWE-197 (Numeric Truncation Error): SQLite's query processing logic fails to enforce that the count of aggregate terms does not exceed the number of columns defined in a query, resulting in an out-of-bounds memory write or read condition. An attacker can trigger this by submitting a specially crafted SQL query with more aggregate terms than columns to any application or service that passes untrusted SQL to a vulnerable SQLite instance. The vulnerability was identified by Google's Big Sleep AI agent, which analyzed SQLite source code and identified the flaw before it could be weaponized; the fix is documented in the SQLite source repository (SQLite Patch, Red Hat Advisory). A proof-of-concept exploit was later published on Exploit-DB (EDB-ID:52499) (Exploit-DB).

Impact

Successful exploitation can result in memory corruption that may allow an attacker to execute arbitrary code, read sensitive data, or crash the service running SQLite, affecting confidentiality, integrity, and availability. Because SQLite is embedded in a vast number of applications, operating systems, and enterprise products — including Apple iOS/macOS/watchOS/tvOS, IBM API Connect, IBM Netezza Appliance, Oracle products, Splunk AppDynamics, and many Linux distributions — the blast radius is extremely broad. Lateral movement is possible if the compromised service has elevated privileges or network access to other internal systems (Apple iOS Advisory, IBM Advisory, Oracle CPU Jan 2026).

Exploitation steps

  1. Reconnaissance: Identify applications or services that accept user-controlled SQL input and embed SQLite versions prior to 3.50.2. This includes web applications, mobile apps, desktop software, and network-accessible services using SQLite as a backend.
  2. Craft malicious SQL query: Construct a SQL query in which the number of aggregate function terms (e.g., COUNT(), SUM(), MAX()) exceeds the number of columns defined in the query's result set or subquery, exploiting the missing bounds check.
  3. Submit the payload: Deliver the crafted SQL query to the target application through any available input vector — HTTP request parameters, file uploads, API calls, or direct database connections — that are passed to the vulnerable SQLite engine.
  4. Trigger memory corruption: SQLite processes the malformed query, causing aggregate term count to exceed column count, resulting in an out-of-bounds memory write or read.
  5. Achieve code execution or crash: Depending on memory layout and exploit refinement, the attacker may achieve arbitrary code execution under the process's privileges, exfiltrate memory contents, or crash the service. Further post-exploitation steps depend on the target environment and service privileges (Exploit-DB, SQLite Patch).

Indicators of compromise

  • Network: Unusual or malformed SQL queries submitted via HTTP/API endpoints containing excessive aggregate function terms relative to column counts; unexpected outbound connections from services embedding SQLite.
  • Logs: Application error logs showing SQLite crashes, assertion failures, or memory corruption errors; stack traces referencing SQLite aggregate processing functions; repeated query errors from the same source IP.
  • File System: Unexpected new files or web shells written to application directories following service crashes; core dump files generated by SQLite-embedding processes.
  • Process: Abnormal child processes spawned by SQLite-embedding services (e.g., shell processes, network utilities); services restarting unexpectedly due to crashes; elevated memory usage or segmentation faults in SQLite-linked processes.
  • Vulnerability Scanners: Detection by Qualys (IDs: 253136, 253131, 253151, etc.) and Nessus (IDs: 242908, 242931, 242939, 242968, etc.) for unpatched SQLite versions (Red Hat Advisory).

Mitigation and workarounds

The primary remediation is to upgrade SQLite to version 3.50.2 or later, which contains the fix for this vulnerability (SQLite Patch). Downstream vendors have released patches: Apple addressed the issue in iOS/iPadOS 18.x (July 2025), watchOS 11.6, tvOS, iOS 26, watchOS 26, and tvOS 26 (Apple iOS Advisory); Oracle included fixes in the July 2025, October 2025, January 2026, and April 2026 Critical Patch Updates (Oracle CPU Jan 2026); Red Hat issued multiple errata (RHSA-2025:11802, RHSA-2025:11803, RHSA-2025:12010, and others); IBM released patches for API Connect, Netezza Appliance, and Rapid Infrastructure Automation; Splunk addressed it in AppDynamics NodeJS Agent (March 2026); Ubuntu issued USN-7679-1; and Amazon Linux, AlmaLinux, and other distributions have released updates. As a workaround where patching is not immediately possible, restrict or sanitize SQL input to prevent user-controlled aggregate expressions, and limit network exposure of services that process untrusted SQL.

Community reactions

The discovery of CVE-2025-6965 by Google's Big Sleep AI agent generated significant media and community attention, as it was reported as the first instance of an AI agent proactively identifying and helping prevent exploitation of a critical zero-day vulnerability before attackers could act. Coverage appeared in The Hacker News, SecurityWeek, The Record, TechRepublic, Digital Trends, Vice, GBHackers, and numerous other outlets (The Hacker News, SecurityWeek). Google CEO Sundar Pichai highlighted the achievement publicly, and the story trended widely on Reddit, Bluesky, and LinkedIn. Security researchers and the broader community discussed the implications for AI-assisted vulnerability research and the future of proactive threat prevention. Microsoft later updated the Windows winsqlite3.dll to address the vulnerability, which itself generated additional community discussion about the widespread embedding of SQLite in operating system components (BleepingComputer).

Additional resources


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