CVE-2021-32839
published high CVSS 3.1 · 7.5Regular Expression Denial of Service in sqlparse
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| andialbrecht | — | sqlparse>= 0.4.0, < 0.4.2 | Affected | Not stated | GitHub_M |
| Debian | bullseye | sqlparse | Advisory build | 0.4.1-1+deb11u1 | DLA-4000-1 |
| Alpine Linux | edge | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| SUSE / openSUSE | SLE-15-SP3 | python3-sqlparsenoarch | Advisory build | 0.4.2-3.3.1 | SUSE-SU-2021:3857-1 |
| Rocky Linux | 8 | libdbsrc | Listed in advisory | Not stated | RLSA-2022:5498 |
| Alpine Linux | v3.14 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.15 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.16 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
Show 48 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Alpine Linux | v3.17 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.18 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.19 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.20 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.21 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.22 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.23 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| Alpine Linux | v3.24 | py3-sqlparse | Fixed | 0.4.2-r0 | Package fix record |
| SUSE / openSUSE | openSUSE-Leap-15.3 | python3-sqlparsenoarch | Advisory build | 0.4.2-3.3.1 | OPENSUSE-SU-2021:3857-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-sqlparseaarch64 | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-sqlparseppc64le | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-sqlparses390x | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-sqlparsex86_64 | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-sqlparseaarch64 | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-sqlparseppc64le | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-sqlparses390x | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-sqlparsex86_64 | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-sqlparseaarch64 | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-sqlparseppc64le | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-sqlparses390x | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-sqlparsex86_64 | Advisory build | 0.5.0-1.1 | OPENSUSE-SU-2024:13938-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparseaarch64 | Advisory build | 0.5.5-2.1 | OPENSUSE-SU-2026:11221-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparseppc64le | Advisory build | 0.5.5-2.1 | OPENSUSE-SU-2026:11221-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparses390x | Advisory build | 0.5.5-2.1 | OPENSUSE-SU-2026:11221-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparsex86_64 | Advisory build | 0.5.5-2.1 | OPENSUSE-SU-2026:11221-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparseaarch64 | Advisory build | 0.5.5-2.1 | OPENSUSE-SU-2026:11221-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparseppc64le | Advisory build | 0.5.5-2.1 | OPENSUSE-SU-2026:11221-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparses390x | Advisory build | 0.5.5-2.1 | OPENSUSE-SU-2026:11221-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparsex86_64 | Advisory build | 0.5.5-2.1 | OPENSUSE-SU-2026:11221-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python36-sqlparseaarch64 | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python36-sqlparseppc64le | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python36-sqlparses390x | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python36-sqlparsex86_64 | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python38-sqlparseaarch64 | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python38-sqlparseppc64le | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python38-sqlparses390x | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python38-sqlparsex86_64 | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-sqlparseaarch64 | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-sqlparseppc64le | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-sqlparses390x | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-sqlparsex86_64 | Advisory build | 0.4.2-1.1 | OPENSUSE-SU-2024:11581-1 |
| Rocky Linux | 8 | libdb-cxxx86_64 | Listed in advisory | Not stated | RLSA-2022:5498 |
| Rocky Linux | 8 | libdb-cxx-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2022:5498 |
| Rocky Linux | 8 | libdb-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2022:5498 |
| Rocky Linux | 8 | libdb-debugsourcex86_64 | Listed in advisory | Not stated | RLSA-2022:5498 |
| Rocky Linux | 8 | libdb-sql-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2022:5498 |
| Rocky Linux | 8 | libdb-sql-devel-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2022:5498 |
| Rocky Linux | 8 | libdb-utils-debuginfox86_64 | Listed in advisory | Not stated | RLSA-2022:5498 |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| andialbrecht | sqlparse | >= 0.4.0, < 0.4.2 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-400 CWE-400 Uncontrolled Resource Consumption
References
3Provider assertions
2GitHub_M · cna
Regular Expression Denial of Service in sqlparse
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- c7b1e886582fc68b4ed7318c523da4b09650ad2c835129ec78a64e3daa75a7eb
- Ingested
- 23 Sep 2026, 07:54:30 UTC
- Source record
- Official CVE record