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.
History

Fri, 21 Aug 2026 13:00:00 +0000

Type Values Removed Values Added
First Time appeared Andialbrecht
Andialbrecht sqlparse
Vendors & Products Andialbrecht
Andialbrecht sqlparse

Mon, 17 Aug 2026 22:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 17 Aug 2026 17:30:00 +0000

Type Values Removed Values Added
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.
Title sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
Weaknesses CWE-94
References
Metrics cvssV4_0

{'score': 6.2, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published: 2026-08-17T17:14:22.314Z

Updated: 2026-08-17T22:01:42.744Z

Reserved: 2026-07-07T16:40:07.983Z

Link: CVE-2026-59894

cve-icon Vulnrichment

Updated: 2026-08-17T21:29:11.972Z

cve-icon NVD

Status : Received

Published: 2026-08-17T18:17:35.913

Modified: 2026-08-17T22:17:16.023

Link: CVE-2026-59894

cve-icon Redhat

No data.