{"id":"CVE-2026-84305","published":"2026-09-01T18:33:10Z","modified":"2026-09-01T19:12:52Z","title":"sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption","vendor":"andialbrecht","product":"sqlparse","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.1,"severity":"MEDIUM","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00189,"percentile":0.08708,"provenance":"source"},"cwes":[{"id":"CWE-407","name":"Inefficient Algorithmic Complexity"}],"references":[{"url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-cfqr-cjx5-5jcm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/andialbrecht/sqlparse/commit/a51df6d9e2d31b44be9adb6bc8732517db6bf96b","tags":["x_refsource_MISC"]},{"url":"https://github.com/andialbrecht/sqlparse/releases/tag/0.6.0","tags":["x_refsource_MISC"]}],"priority":{"score":5.3,"factors":[{"name":"EPSS percentile","points":1.74},{"name":"CVSS severity","points":3.57}]},"vendorSlug":"andialbrecht","affectedVersions":[{"vendor":"andialbrecht","product":"sqlparse","versions":["< 0.6.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-09-01T19:12:32.847258Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"sqlparse","vulnerableRanges":["<0.6.0"],"patched":["0.6.0"],"from":["GHSA-cfqr-cjx5-5jcm","PYSEC-2026-3923"],"provenance":"source"}],"summary":{"text":"The sqlparse Python SQL parsing module has a flaw in its reindent formatting path (ReindentFilter._get_offset() in sqlparse/filters/reindent.py), where attacker-controlled parenthesized tuple lists passed through sqlparse.format(sql, reindent=True) or the sqlformat --reindent command cause quadratic CPU consumption. An attacker who can supply SQL input to a sqlparse reindent call, with no authentication or user interaction required, can cause request delays, reduced throughput, or worker starvation, though only for inputs that stay below the module's grouping-token cap.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:20:03Z"},"euvd":{"id":"EUVD-2026-69421","exploited":false,"provenance":"source"}}