CVE-2026-51304
Received Received - Intake

Use-After-Free in SQLite 3.41 ORDER BY Parsing

Vulnerability report for CVE-2026-51304, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-27

Last updated on: 2026-07-27

Assigner: MITRE

Description

sqlite 3.41 has a use-after-free (UAF) vulnerability in the ORDER BY clause parsing routine. The affected code first releases the memory of an ExprList object via sqlite3ExprListDelete(), then attempts to access the nExpr member of the already freed object. This dangling pointer access causes invalid memory read operations. By constructing a malicious SQL statement containing an ORDER BY clause with a large number of items, a remote adversary can trigger this vulnerability. Successful exploitation can result in application crash (denial of service), leakage of sensitive memory contents, and under certain memory layout conditions, arbitrary code execution on the affected system.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-27
Last Modified
2026-07-27
Generated
2026-07-27
AI Q&A
2026-07-27
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
sqlite sqlite 3.41
sqlite sqlite From 3.41 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-416 The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-51304 is a use-after-free (UAF) vulnerability in SQLite version 3.41. It occurs in the ORDER BY clause parsing routine where memory of an ExprList object is freed but the pointer is not set to null. The code then attempts to access the freed memory, causing invalid reads.

Detection Guidance

To detect this vulnerability, monitor for crashes or memory corruption when processing SQL queries with long ORDER BY clauses. Use tools like AddressSanitizer during compilation to detect use-after-free errors. Test with a proof-of-concept query containing a large number of ORDER BY terms.

Impact Analysis

This vulnerability can cause application crashes (denial of service), leakage of sensitive memory contents, and under certain conditions, arbitrary code execution. Exploitation requires only remote SQL execution access without needing local file access or elevated privileges.

Compliance Impact

This vulnerability could lead to unauthorized memory access, potentially exposing sensitive data such as personally identifiable information (PII) or protected health information (PHI). For GDPR, this may result in data breaches requiring notification under Articles 33-34. For HIPAA, it could violate the Security Rule's integrity and confidentiality requirements, leading to compliance violations and penalties.

Mitigation Strategies

Immediately upgrade SQLite to a patched version if available. If no patch exists, restrict SQL execution permissions to trusted users only. Avoid processing untrusted SQL queries with complex ORDER BY clauses until a fix is released.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-51304. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart