{"id":"CVE-2026-54284","published":"2026-08-17T17:43:48Z","modified":"2026-08-17T19:32:42Z","title":"sqlparse: TokenList.__init__ materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger","vendor":"andialbrecht","product":"sqlparse","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.7,"severity":"HIGH","version":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00445,"percentile":0.30559,"provenance":"source"},"cwes":[{"id":"CWE-407","name":"Inefficient Algorithmic Complexity"},{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity"}],"references":[{"url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-pwgv-4x5q-6m9f","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/andialbrecht/sqlparse/commit/939b129e24c0ad5d51368b1aa72fffcaca76f06f","tags":["x_refsource_MISC"]}],"priority":{"score":12.2,"factors":[{"name":"EPSS percentile","points":6.11},{"name":"CVSS severity","points":6.09}]},"vendorSlug":"andialbrecht","affectedVersions":[{"vendor":"andialbrecht","product":"sqlparse","versions":["< 0.6.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-08-17T19:31:59.285704Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"sqlparse","vulnerableRanges":["<0.6.0"],"patched":["0.6.0"],"from":["GHSA-pwgv-4x5q-6m9f","PYSEC-2026-3699"],"provenance":"source"}],"summary":{"text":"The flaw is in the TokenList construction and string conversion code in the sqlparse/sql.py component of sqlparse, a Python SQL parsing module, where nested token subtrees built by group_parenthesis and group_case are repeatedly flattened. An attacker who can get crafted SQL input to sqlparse.parse(), sqlparse.format() or sqlparse.split() can consume CPU at a quadratic rate, with no authentication or user interaction required and reachable over the network, before the existing depth and token limits stop processing.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:51:42Z"},"euvd":{"id":"EUVD-2026-60313","exploited":false,"provenance":"source"}}