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.
Severity (CVSS)
| Base score | 8.7 |
|---|---|
| Severity | High |
| Version | CVSS 4.0 |
| 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 |
| Provided by | CNA |
Weaknesses
- CWE-407 — CWE-407: Inefficient Algorithmic Complexity
- CWE-1333 — CWE-1333: Inefficient Regular Expression Complexity
Affected products
| Vendor | Product | Versions |
|---|---|---|
| andialbrecht | sqlparse | < 0.6.0 |
References
Generated from the official CVE List on 18 Aug 2026 07:05 UTC.