
CVE catalog
CVE-2021-32839
sqlparse: CVE-2021-32839
- Severity
- High · CVSS 7.5
CVSS: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.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | sqlparse | sid | 0.5.5-2 | fixed |
| Debian | sqlparse | forky | 0.5.5-2 | fixed |
| Debian | sqlparse | trixie | 0.5.3-1 | fixed |
| Debian | sqlparse | bookworm | 0.4.2-1+deb12u1 | fixed |
| Opensuse | python-sqlparse | tumbleweed | 0.5.5-2.1 | fixed |
| Opensuse | python-sqlparse | tumbleweed | 0.5.0-1.1 | fixed |
| Opensuse | python-sqlparse | tumbleweed | 0.4.2-1.1 | fixed |
| Ubuntu | sqlparse | 22.04 | 0.4.1-1ubuntu1 | fixed |
| Suse | python-sqlparse | linux enterprise module for basesystem 15 sp3 | 0.4.2-3.3.1 | fixed |
| Opensuse | python-sqlparse | leap 15.3 | 0.4.2-3.3.1 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | sqlparse | source | sid | 0.4.2-1 | not yet assigned | Not reported | [994841] |
| Debian | sqlparse | source | forky | 0.4.2-1 | not yet assigned | Not reported | [994841] |
| Debian | sqlparse | source | trixie | 0.4.2-1 | not yet assigned | Not reported | [994841] |
| Debian | sqlparse | source | bookworm | 0.4.2-1 | not yet assigned | Not reported | [994841] |
| Opensuse | python-sqlparse | rpm | tumbleweed | 0.5.5-2.1 | Not reported | OPENSUSE-SU-2026:11221-1 | Not reported |
| Opensuse | python-sqlparse | rpm | tumbleweed | 0.5.0-1.1 | Not reported | OPENSUSE-SU-2024:13938-1 | Not reported |
| Opensuse | python-sqlparse | rpm | tumbleweed | 0.4.2-1.1 | Not reported | OPENSUSE-SU-2024:11581-1 | Not reported |
| Ubuntu | sqlparse | deb | 22.04 | 0.4.1-1ubuntu1 | Not reported | UBUNTU-CVE-2021-32839 | Not reported |
| Suse | python-sqlparse | rpm | linux enterprise module for basesystem 15 sp3 | 0.4.2-3.3.1 | Not reported | SUSE-SU-2021:3857-1 | Not reported |
| Opensuse | python-sqlparse | rpm | leap 15.3 | 0.4.2-3.3.1 | Not reported | OPENSUSE-SU-2021:3857-1 | Not reported |
OpenFactory catalog packages
[openSUSE Tumbleweed]
- [python313-sqlparse]Unknown
Source package: [python-sqlparse]
Details (1)
0.6.0-1.1· noarch · tumbleweedUnknown · Fixed:
0.4.2-1.1, 0.5.0-1.1, 0.5.5-2.1Version impact unknown
dsa · python-sqlparse · opensuse · tumbleweed
- [python314-sqlparse]Unknown
Source package: [python-sqlparse]
Details (1)
0.6.0-1.1· noarch · tumbleweedUnknown · Fixed:
0.4.2-1.1, 0.5.0-1.1, 0.5.5-2.1Version impact unknown
dsa · python-sqlparse · opensuse · tumbleweed
[Debian 12 (Bookworm)]
- [python3-sqlparse]Fixed
Source package: [sqlparse]
Details (2)
0.4.2-1+deb12u1· all · bookwormFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12
0.4.2-1+deb12u1· all · bookwormFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12
- [python-sqlparse-doc]Fixed
Source package: [sqlparse]
Details (2)
0.4.2-1+deb12u1· all · bookwormFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12
0.4.2-1+deb12u1· all · bookwormFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12
- [sqlformat]Fixed
Source package: [sqlparse]
Details (2)
0.4.2-1+deb12u1· all · bookwormFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12
0.4.2-1+deb12u1· all · bookwormFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · bookworm; dsa · sqlparse · debian · 12
[Debian 13 (Trixie)]
- [python3-sqlparse]Fixed
Source package: [sqlparse]
Details (2)
0.5.3-1· all · trixieFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · 13
0.5.3-1· all · trixieFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · 13
- [python-sqlparse-doc]Fixed
Source package: [sqlparse]
Details (2)
0.5.3-1· all · trixieFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · 13
0.5.3-1· all · trixieFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · 13
- [sqlformat]Fixed
Source package: [sqlparse]
Details (2)
0.5.3-1· all · trixieFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · 13
0.5.3-1· all · trixieFixed · Fixed:
0.4.2-1dsa · sqlparse · debian · 13
Observed:
References
- [https://access.redhat.com/errata/RHSA-2022:5498]
- [https://ftp.suse.com/pub/projects/security/csaf/opensuse-su-2026_11221-1.json]
- [https://osv.dev/vulnerability/DEBIAN-CVE-2021-32839]
- [https://osv.dev/vulnerability/DLA-4000-1]
- [https://osv.dev/vulnerability/SUSE-SU-2021:3857-1]
- [https://osv.dev/vulnerability/UBUNTU-CVE-2021-32839]
- [https://osv.dev/vulnerability/openSUSE-SU-2021:3857-1]
- [https://osv.dev/vulnerability/openSUSE-SU-2024:11581-1]
- [https://osv.dev/vulnerability/openSUSE-SU-2024:13938-1]
- [https://osv.dev/vulnerability/openSUSE-SU-2026:11221-1]
- [https://security-tracker.debian.org/tracker/CVE-2021-32839]
[Debian Security Tracker] · [FIRST EPSS] · [OSV Package Vulnerability Database] · [Red Hat security advisories and VEX] · [SUSE security advisories and VEX]