CVE catalog

CVE-2026-59894

sqlparse: CVE-2026-59894

[CVE catalog]

Severity
Medium · CVSS 6.2CVSS: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
Published
Source
[NVD] · [CVE record]
EPSS
0.13% · Oct 25, 2026

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.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debiansqlparsesid0.5.5-2vulnerable
Debiansqlparseforky0.5.5-2vulnerable
Debiansqlparsetrixie0.5.3-1vulnerable
Debiansqlparsebookworm0.4.2-1+deb12u1vulnerable
PyPIsqlparseNot reported0.6.0fixed
PyPIsqlparseNot reported0.6.0fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debiansqlparsesourcesid(unfixed)not yet assignedNot reported[1144932]
Debiansqlparsesourceforky(unfixed)not yet assignedNot reported[1144932]
Debiansqlparsesourcetrixie(unfixed)not yet assignedNot reported[1144932]
Debiansqlparsesourcebookworm(unfixed)not yet assignedNot reported[1144932]
PyPIsqlparsePyPINot reported0.6.0Not reportedGHSA-3496-9G83-7V6XNot reported
PyPIsqlparsePyPINot reported0.6.0Not reportedPYSEC-2026-3696Not reported

[Debian bug #1144932]

Notes

[trixie] sqlparse: Minor issue [bookworm] sqlparse: Minor issue

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • Source package: [sqlparse]

    Details (2)
    • 0.4.2-1+deb12u1 · all · bookworm

      Affected

      dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12

    • 0.4.2-1+deb12u1 · all · bookworm

      Affected

      dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12

  • Source package: [sqlparse]

    Details (2)
    • 0.4.2-1+deb12u1 · all · bookworm

      Affected

      dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12

    • 0.4.2-1+deb12u1 · all · bookworm

      Affected

      dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12

  • [sqlformat]Affected

    Source package: [sqlparse]

    Details (2)
    • 0.4.2-1+deb12u1 · all · bookworm

      Affected

      dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12

    • 0.4.2-1+deb12u1 · all · bookworm

      Affected

      dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12

[Debian 13 (Trixie)]

  • Source package: [sqlparse]

    Details (2)
    • 0.5.3-1 · all · trixie

      Affected

      dsa · sqlparse · debian · 13

    • 0.5.3-1 · all · trixie

      Affected

      dsa · sqlparse · debian · 13

  • Source package: [sqlparse]

    Details (2)
    • 0.5.3-1 · all · trixie

      Affected

      dsa · sqlparse · debian · 13

    • 0.5.3-1 · all · trixie

      Affected

      dsa · sqlparse · debian · 13

  • [sqlformat]Affected

    Source package: [sqlparse]

    Details (2)
    • 0.5.3-1 · all · trixie

      Affected

      dsa · sqlparse · debian · 13

    • 0.5.3-1 · all · trixie

      Affected

      dsa · sqlparse · debian · 13

Observed:

References