CVE-2026-54284

sqlparse: TokenList.__init__ materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger

State
Published
Severity
8.7 High
Published
Aug 17, 2026
Updated
Aug 17, 2026
Reserved
Jun 12, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.08.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NGitHub_M

Weaknesses

  • CWE-407 Inefficient Algorithmic Complexity
  • CWE-1333 Inefficient Regular Expression Complexity

Affected Products

ProductVersions
sqlparseandialbrecht
  • < 0.6.0Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.