{"id":"CVE-2026-59894","state":"PUBLISHED","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 generated source. This issue is fixed in version 0.6.0.","publishedAt":"2026-08-17T17:14:22.314Z","updatedAt":"2026-08-17T22:01:42.744Z","severity":{"score":6.2,"label":"Medium","version":"4.0","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","source":"GitHub_M"},"assigner":"GitHub_M","products":["andialbrecht sqlparse"],"affected":[{"vendor":"andialbrecht","product":"sqlparse","versions":[{"version":"< 0.6.0","status":"affected"}]}],"references":["https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x"],"weaknesses":["CWE-94"],"ingestedAt":"2026-10-29T20:12:32.778Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/59xxx/CVE-2026-59894.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-59894","state":"PUBLISHED","datePublished":"2026-08-17T17:14:22.314Z","dateUpdated":"2026-08-17T22:01:42.744Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-07-07T16:40:07.983Z"},"containers":{"cna":{"title":"sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"andialbrecht","product":"sqlparse","versions":[{"version":"< 0.6.0","status":"affected"}]}],"references":[{"url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x","name":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x","tags":["x_refsource_CONFIRM"]}],"metrics":[{"cvssV4_0":{"attackVector":"LOCAL","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"PASSIVE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"NONE","subConfidentialityImpact":"HIGH","subIntegrityImpact":"HIGH","subAvailabilityImpact":"LOW","baseScore":6.2,"baseSeverity":"MEDIUM","vectorString":"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","version":"4.0"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-94","lang":"en","description":"CWE-94: Improper Control of Generation of Code ('Code Injection')","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-08-17T17:14:22.314Z"},"source":{"advisory":"GHSA-3496-9g83-7v6x","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-08-17T21:29:10.782733Z","id":"CVE-2026-59894","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-08-17T22:01:42.744Z"}}]}}}