CVE-2026-59894

sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes

MEDIUM
6.2
CVSS Score
Published: August 17, 2026 at 05:14 PM UTC
Updated: October 23, 2026 at 04:10 PM UTC
1 product affected across 1 vendorSqlparse

Using sqlparse by andialbrecht?

Get instant alerts when new vulnerabilities affect sqlparse - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM6.2
Exploit prediction
EPSS 0.1%
SSVC
No known exploit

Description

sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse/filters/output.py fails to escape existing backslashes before quotes in sqlparse.format output_format='python' and output_format='php' and the corresponding sqlformat -l modes, allowing crafted SQL to terminate the generated string and inject Python or PHP code when a downstream consumer executes or imports the generated source. This issue is fixed in version 0.6.0.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 0.6.0
Affected range stops below 0.6.0, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

6.2MEDIUMGitHub_M
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-94

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card