Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. sqlparse
  4. ›
  5. CVE-2026-59894

CVE-2026-59894: sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes

August 17, 2026

The documented Python and PHP output modes generate source-code snippets from caller-supplied SQL. Their output filters escape quote characters without first escaping existing backslashes. Crafted SQL can therefore neutralize the generated quote escape, terminate the intended language string, and place attacker-controlled code into the generated snippet. If a downstream consumer executes or imports that generated source, the injected code runs in the consumer’s environment.

References

  • github.com/advisories/GHSA-3496-9g83-7v6x
  • github.com/andialbrecht/sqlparse/commit/53ff44b53e27cff78259acc1af015506fea60f63
  • github.com/andialbrecht/sqlparse/security/advisories/GHSA-3496-9g83-7v6x
  • nvd.nist.gov/vuln/detail/CVE-2026-59894

Code Behaviors & Features

Detect and mitigate CVE-2026-59894 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.6.0

Fixed versions

  • 0.6.0

Solution

Upgrade to version 0.6.0 or above.

Impact 7.3 HIGH

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L

Learn more about CVSS

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

pypi/sqlparse/CVE-2026-59894.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:53 +0000.