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.

Project Subscriptions

No data.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-3496-9g83-7v6x sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

History

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'}


Projects

Sign in to view the affected projects.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

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

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

Link: CVE-2026-59894

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

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

Modified: 2026-08-17T18:17:35.913

Link: CVE-2026-59894

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-17T18:30:04Z

Weaknesses