CVE catalog

CVE-2021-32839

sqlparse: CVE-2021-32839

[CVE catalog]

Severity
High · CVSS 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Published
Source
[NVD] · [CVE record]
EPSS
2.34% · Oct 25, 2026

sqlparse is a non-validating SQL parser module for Python. In sqlparse versions 0.4.0 and 0.4.1 there is a regular Expression Denial of Service in sqlparse vulnerability. The regular expression may cause exponential backtracking on strings containing many repetitions of '\r\n' in SQL comments. Only the formatting feature that removes comments from SQL statements is affected by this regular expression. As a workaround don't use the sqlformat.format function with keyword strip_comments=True or the --strip-comments command line flag when using the sqlformat command line tool. The issues has been fixed in sqlparse 0.4.2.

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-2fixed
Debiansqlparseforky0.5.5-2fixed
Debiansqlparsetrixie0.5.3-1fixed
Debiansqlparsebookworm0.4.2-1+deb12u1fixed
Opensusepython-sqlparsetumbleweed0.5.5-2.1fixed
Opensusepython-sqlparsetumbleweed0.5.0-1.1fixed
Opensusepython-sqlparsetumbleweed0.4.2-1.1fixed
Ubuntusqlparse22.040.4.1-1ubuntu1fixed
Susepython-sqlparselinux enterprise module for basesystem 15 sp30.4.2-3.3.1fixed
Opensusepython-sqlparseleap 15.30.4.2-3.3.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debiansqlparsesourcesid0.4.2-1not yet assignedNot reported[994841]
Debiansqlparsesourceforky0.4.2-1not yet assignedNot reported[994841]
Debiansqlparsesourcetrixie0.4.2-1not yet assignedNot reported[994841]
Debiansqlparsesourcebookworm0.4.2-1not yet assignedNot reported[994841]
Opensusepython-sqlparserpmtumbleweed0.5.5-2.1Not reportedOPENSUSE-SU-2026:11221-1Not reported
Opensusepython-sqlparserpmtumbleweed0.5.0-1.1Not reportedOPENSUSE-SU-2024:13938-1Not reported
Opensusepython-sqlparserpmtumbleweed0.4.2-1.1Not reportedOPENSUSE-SU-2024:11581-1Not reported
Ubuntusqlparsedeb22.040.4.1-1ubuntu1Not reportedUBUNTU-CVE-2021-32839Not reported
Susepython-sqlparserpmlinux enterprise module for basesystem 15 sp30.4.2-3.3.1Not reportedSUSE-SU-2021:3857-1Not reported
Opensusepython-sqlparserpmleap 15.30.4.2-3.3.1Not reportedOPENSUSE-SU-2021:3857-1Not reported

[Debian bug #994841]

OpenFactory catalog packages

[openSUSE Tumbleweed]

  • Source package: [python-sqlparse]

    Details (1)
    • 0.6.0-1.1 · noarch · tumbleweed

      Unknown · Fixed: 0.4.2-1.1, 0.5.0-1.1, 0.5.5-2.1

      Version impact unknown

      dsa · python-sqlparse · opensuse · tumbleweed

  • Source package: [python-sqlparse]

    Details (1)
    • 0.6.0-1.1 · noarch · tumbleweed

      Unknown · Fixed: 0.4.2-1.1, 0.5.0-1.1, 0.5.5-2.1

      Version impact unknown

      dsa · python-sqlparse · opensuse · tumbleweed

[Debian 12 (Bookworm)]

  • Source package: [sqlparse]

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

      Fixed · Fixed: 0.4.2-1

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

    • 0.4.2-1+deb12u1 · all · bookworm

      Fixed · Fixed: 0.4.2-1

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

  • Source package: [sqlparse]

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

      Fixed · Fixed: 0.4.2-1

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

    • 0.4.2-1+deb12u1 · all · bookworm

      Fixed · Fixed: 0.4.2-1

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

  • [sqlformat]Fixed

    Source package: [sqlparse]

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

      Fixed · Fixed: 0.4.2-1

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

    • 0.4.2-1+deb12u1 · all · bookworm

      Fixed · Fixed: 0.4.2-1

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

[Debian 13 (Trixie)]

  • Source package: [sqlparse]

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

      Fixed · Fixed: 0.4.2-1

      dsa · sqlparse · debian · 13

    • 0.5.3-1 · all · trixie

      Fixed · Fixed: 0.4.2-1

      dsa · sqlparse · debian · 13

  • Source package: [sqlparse]

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

      Fixed · Fixed: 0.4.2-1

      dsa · sqlparse · debian · 13

    • 0.5.3-1 · all · trixie

      Fixed · Fixed: 0.4.2-1

      dsa · sqlparse · debian · 13

  • [sqlformat]Fixed

    Source package: [sqlparse]

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

      Fixed · Fixed: 0.4.2-1

      dsa · sqlparse · debian · 13

    • 0.5.3-1 · all · trixie

      Fixed · Fixed: 0.4.2-1

      dsa · sqlparse · debian · 13

Observed:

References