CVE-2026-71491 sqlparse: Quadratic O(n²) DoS in group_comments
An attacker can cause excessive CPU consumption and denial of service by submitting crafted SQL input to the sqlparse library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-71491?
CVE-2026-71491 is a high-severity denial of service vulnerability in andialbrecht sqlparse, published on 17 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, group_comments in sqlparse/engine/grouping.py repeatedly rescans comment-only statements before the MAX_GROUPING_TOKENS guard, causing quadratic CPU consumption through sqlparse.parse() and sqlparse.format(sql, strip_comments=True). This issue is fixed in version 0.6.0.
Which versions are affected by CVE-2026-71491?
3 open source packages ship an affected version, including sqlparse.
| Package | Affected | Fixed in |
|---|---|---|
sqlparse PyPI | All versions | 0.6.0 |
sqlparse PyPI | All versions | 0.6.0 |
sqlparse PyPI | All versions | 0.6.0 |
How do I fix CVE-2026-71491?
Upgrade sqlparse to 0.6.0 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2026-71491 being exploited?
There is no known exploitation of CVE-2026-71491 in the wild and no public exploit code.
Sources
Also known as CLEANSTART-2026-HH21892, CLEANSTART-2026-NU38917, CLEANSTART-2026-PH27311, DEBIAN-CVE-2026-71491, ECHO-f355-4a28-b67e, GHSA-f2ff-p2ww-7p4p and 8 more.