Vulnerability · Published Aug 17, 2026 · Assigned by GitHub_M
CVE-2026-54284sqlparse: TokenList.__init__ materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger
High 8.7
In plain English
A high-severity regular-expression denial of service 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.3% (higher than 27% 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, TokenList construction and string conversion in sqlparse/sql.py repeatedly flatten nested token subtrees constructed by group_parenthesis and group_case, causing quadratic CPU consumption through sqlparse.parse(), sqlparse.format(), and sqlparse.split() before depth and token limits terminate processing. 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-54284 |
| Debian:13 | sqlparse | no fix listed | DEBIAN-CVE-2026-54284 |
| Debian:14 | sqlparse | no fix listed | DEBIAN-CVE-2026-54284 |
| PyPI | sqlparse | 0.6.0 | PYSEC-2026-3699 |
| PyPI | sqlparse | 0.6.0 | GHSA-pwgv-4x5q-6m9f |
| Ubuntu:22.04:LTS | sqlparse | 0.4.2-1ubuntu0.22.04.3 | UBUNTU-CVE-2026-54284 |
| Ubuntu:22.04:LTS | sqlparse | 0.4.2-1ubuntu0.22.04.3 | USN-8808-1 |
| Ubuntu:24.04:LTS | sqlparse | 0.4.4-1ubuntu0.2 | USN-8808-1 |
| Ubuntu:24.04:LTS | sqlparse | 0.4.4-1ubuntu0.2 | UBUNTU-CVE-2026-54284 |
| Ubuntu:26.04:LTS | sqlparse | 0.5.4-1ubuntu0.1 | USN-8808-1 |
| Ubuntu:26.04:LTS | sqlparse | 0.5.4-1ubuntu0.1 | UBUNTU-CVE-2026-54284 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| andialbrecht | sqlparse | < 0.6.0 |
Weakness: CWE-407, CWE-1333 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N