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.
Published: 2026-08-17
Score: 6.2 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Analysis and contextual insights are available on OpenCVE Cloud.

Remediation

No vendor fix or workaround currently provided.

Additional remediation guidance may be available on OpenCVE Cloud.

Tracking

Sign in to view the affected projects.

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
History

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


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

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.

cve-icon OpenCVE Enrichment

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

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')