Vulnerability · Published Sep 1, 2026 · Assigned by GitHub_M
CVE-2026-84305sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption
Medium 5.1
In plain English
A medium-severity security flaw in sqlparse from andialbrecht. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 9% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, sqlparse.format(sql, reindent=True) and sqlformat --reindent route attacker-controlled parenthesized tuple lists through ReindentFilter._get_offset() in sqlparse/filters/reindent.py, where _flatten_up_to_token() repeatedly rebuilds and joins the statement prefix. Thousands of offset calculations walk an expanding token tree, producing quadratic CPU consumption for inputs that remain below MAX_GROUPING_TOKENS and causing request delays, reduced throughput, or worker starvation. This issue is fixed in version 0.6.0.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | sqlparse | no fix listed | DEBIAN-CVE-2026-84305 |
| Debian:13 | sqlparse | no fix listed | DEBIAN-CVE-2026-84305 |
| Debian:14 | sqlparse | no fix listed | DEBIAN-CVE-2026-84305 |
| PyPI | sqlparse | 0.6.0 | GHSA-cfqr-cjx5-5jcm |
| PyPI | sqlparse | 0.6.0 | PYSEC-2026-3923 |
| Ubuntu:22.04:LTS | sqlparse | no fix listed | UBUNTU-CVE-2026-84305 |
| Ubuntu:24.04:LTS | sqlparse | no fix listed | UBUNTU-CVE-2026-84305 |
| Ubuntu:26.04:LTS | sqlparse | no fix listed | UBUNTU-CVE-2026-84305 |
| Ubuntu:26.10 | sqlparse | no fix listed | UBUNTU-CVE-2026-84305 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| andialbrecht | sqlparse | < 0.6.0 |
Weakness: CWE-407 · Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N