CVE-2026-59894
MEDIUM 6.2CVSS 4.0sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes
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
- 17 Aug 2026
- Last modified
- 23 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Deferred
- Weakness
- CWE-94
- Also known as
- GHSA-3496-9g83-7v6xPYSEC-2026-3696
- Sources
- NVDJSONOSV GHSA-3496-9g83-7v6xJSONOSV PYSEC-2026-3696JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | MEDIUM 6.2 | 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | 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 | |
| OSV | PyPA | CVSS 4.0 | 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 |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | PyPI | sqlparse | < 0.6.0 | 0.6.0 |
References
- https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x · WEB
- https://github.com/andialbrecht/sqlparse/commit/53ff44b53e27cff78259acc1af015506fea60f63 · WEB
- https://github.com/andialbrecht/sqlparse · PACKAGE
- https://pypi.org/project/sqlparse · PACKAGE
- https://github.com/advisories/GHSA-3496-9g83-7v6x · ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2026-59894 · ADVISORY
History
- 25 Nov 2026 21:04 UTC · NVD: first stored (published 17 Aug 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 19 Aug 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 17 Aug 2026)