{"id":"CVE-2026-84305","summary":"sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption","details":"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.","aliases":["GHSA-cfqr-cjx5-5jcm"],"modified":"2026-09-02T03:47:23.069891288Z","published":"2026-09-01T18:33:10.969Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-407"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/84xxx/CVE-2026-84305.json"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/84xxx/CVE-2026-84305.json"},{"type":"FIX","url":"https://github.com/andialbrecht/sqlparse/commit/a51df6d9e2d31b44be9adb6bc8732517db6bf96b"},{"type":"WEB","url":"https://github.com/andialbrecht/sqlparse/releases/tag/0.6.0"},{"type":"ADVISORY","url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-cfqr-cjx5-5jcm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84305"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/andialbrecht/sqlparse","events":[{"introduced":"0"},{"fixed":"2f40da99b50d81135aecf96f6b08fcfa338a96de"}],"database_specific":{"source":"AFFECTED_FIELD","extracted_events":[{"introduced":"0"},{"fixed":"0.6.0"}]}}],"versions":["0.5.5","0.5.4","0.5.3","0.5.2","0.5.1","0.5.0","0.4.4","0.4.3","0.4.2","0.4.1","0.4.0","0.3.1","0.3.0","0.2.4","0.2.3","0.2.2","0.2.1","0.2.0","0.1.18","0.1.17","0.1.16","0.1.15","0.1.14","0.1.13","0.1.12","0.1.11","0.1.10","0.1.9","0.1.8","0.1.7","0.1.6","0.1.5","0.1.3","0.1.2","0.1.1","0.1.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-84305.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}