{"id":"CVE-2026-59894","summary":"sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes","details":"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.","aliases":["GHSA-3496-9g83-7v6x","PYSEC-2026-3696"],"modified":"2026-09-10T18:27:14.905267742Z","published":"2026-08-17T17:14:22.314Z","related":["SUSE-SU-2026:3762-1","SUSE-SU-2026:3906-1","SUSE-SU-2026:3907-1","SUSE-SU-2026:3910-1","openSUSE-SU-2026:11557-1","openSUSE-SU-2026:21690-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59894.json","cna_assigner":"GitHub_M","cwe_ids":["CWE-94"]},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59894.json"},{"type":"ADVISORY","url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59894"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/andialbrecht/sqlparse","events":[{"introduced":"0"},{"fixed":"2f40da99b50d81135aecf96f6b08fcfa338a96de"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"fixed":"0.6.0"}],"source":"AFFECTED_FIELD"}}],"versions":["0.5.5","0.5.4","0.5.3","0.5.2","0.5.1","0.5.0","0.4.4","0.4.3","0.4.2","0.4.1","0.4.0","0.3.1","0.3.0","0.2.4","0.2.3","0.2.2","0.2.1","0.2.0","0.1.18","0.1.17","0.1.16","0.1.15","0.1.14","0.1.13","0.1.12","0.1.11","0.1.10","0.1.9","0.1.8","0.1.7","0.1.6","0.1.5","0.1.3","0.1.2","0.1.1","0.1.0"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-59894.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}