{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-59894","id":"CVE-2026-59894","title":"sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes","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 gen","descriptionLong":"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-17T17:14:22.314Z","updated":"2026-10-28T02:30:28.973687982Z","reserved":"2026-07-07T16:40:07.983Z","status":"Deferred","rejected":false,"assigner":"GitHub_M","metric":{"version":"4.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","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"4.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","rating":"medium","source":"GitHub_M"},{"version":"4.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/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","rating":"medium","source":"github.com"},{"version":"4.0","score":null,"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","rating":"unrated","source":"OSV"},{"version":"4.0","score":null,"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","rating":"medium","source":"GitHub"}],"rating":"medium","products":["andialbrecht sqlparse"],"affectedProducts":[{"vendor":"andialbrecht","product":"sqlparse","defaultStatus":null,"versions":[{"version":"< 0.6.0","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"sqlparse","purl":"pkg:pypi/sqlparse","ranges":["<0.6.0"],"fixed":["0.6.0"],"advisory":"GHSA-3496-9g83-7v6x"}],"cwes":["CWE-94"],"aliases":["GHSA-3496-9g83-7v6x","PYSEC-2026-3696"],"references":[{"url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59894.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59894","tags":["advisory"]},{"url":"https://github.com/andialbrecht/sqlparse/commit/53ff44b53e27cff78259acc1af015506fea60f63","tags":["web"]},{"url":"https://github.com/andialbrecht/sqlparse","tags":["package"]},{"url":"https://pypi.org/project/sqlparse","tags":["package"]},{"url":"https://github.com/advisories/GHSA-3496-9g83-7v6x","tags":["advisory"]}],"patchReferenced":false,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00129,"epssPercentile":0.02588,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-59894","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59894","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-59894","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-3496-9g83-7v6x","ok":true,"note":"GHSA-3496-9g83-7v6x"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-59894","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}