7.5

CVE-2021-32839: Regular Expression Denial of Service in sqlparse

Modified
AliasesSUSE-SU-2021:3857-1GHSA-p5w8-wqhj-9hhfPYSEC-2021-333
Published 20-09-2021Last modified 03-11-2025

Vulnerability summary

CVE-2021-32839 is a high (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in andialbrecht sqlparse. EPSS estimates a 2.34% chance of exploitation in the next 30 days, higher than 83.6% of scored vulnerabilities.

Priority
Prioritisesevere

Severe, CVSS 7.5 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 2% (FIRST, 03-11-2026)

Source freshness unavailable

How is this decided?
CVSS score
7.5/10
010
High · v3.1 (CVE.org)
EPSS score
2.34%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Advisory lineage

Upstream 0 · Downstream 4 · Related 2

Timeline

  1. 20-09-2021
    PublishedVulnerability first disclosed.
  2. 03-11-2025
    Last modifiedVulnerability information updated.

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.

CVSS metrics

8 scores · 6 sources · 3 versions

EPSS trend

Probability

2.34%

Chance of exploitation in the next 30 days

Percentile

84%

Versus all other CVEs

30-day change

No change 0.00 pp

From 2.34% on 04-10-2026

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.

Opensuse2 products
  • python-sqlparse&distro=openSUSE Leap 15.3< 0.4.2-3.3.1
  • python-sqlparse&distro=openSUSE Tumbleweed< 0.4.2-1.1
Alpine1 product
  • py3-sqlparse< 0.4.2-r0
Andialbrecht1 product
Debian1 product
  • sqlparse< 0.4.2-1
PyPI1 product
  • sqlparse≥ 1499cffcd7c4d635b4297b44d48fb4fe94cf988e, < 8238a9e450ed1524e40cb3a8b0b3c00606903aeb | ≥ 0.4.0, < 0.4.2
Sqlparse_project1 product
Suse1 product
  • python-sqlparse&distro=SUSE Linux Enterprise Module for Basesystem 15 SP3< 0.4.2-3.3.1
Ubuntu1 product
  • sqlparse< 0.4.1-1ubuntu1

8 vendors · 9 products

References

16 links
Show all 16 references