{"id":"CVE-2026-71491","published":"2026-08-17T17:16:48Z","modified":"2026-08-17T22:01:34Z","title":"sqlparse: Quadratic O(n²) DoS in group_comments","vendor":"andialbrecht","product":"sqlparse","tier":"tail","description":{"text":"sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, group_comments in sqlparse/engine/grouping.py repeatedly rescans comment-only statements before the MAX_GROUPING_TOKENS guard, causing quadratic CPU consumption through sqlparse.parse() and sqlparse.format(sql, strip_comments=True). 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.00263,"percentile":0.1846,"provenance":"source"},"cwes":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption"},{"id":"CWE-407","name":"Inefficient Algorithmic Complexity"}],"references":[{"url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-f2ff-p2ww-7p4p","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/andialbrecht/sqlparse/commit/ef2012a5eeb491e604dea2b00d516904a3830c87","tags":["x_refsource_MISC"]}],"priority":{"score":9.8,"factors":[{"name":"EPSS percentile","points":3.69},{"name":"CVSS severity","points":6.09}]},"vendorSlug":"andialbrecht","affectedVersions":[{"vendor":"andialbrecht","product":"sqlparse","versions":["< 0.6.0"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-08-17T22:00:09.876988Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"sqlparse","vulnerableRanges":["<0.6.0"],"patched":["0.6.0"],"from":["GHSA-f2ff-p2ww-7p4p","PYSEC-2026-3697"],"provenance":"source"}],"summary":{"text":"sqlparse, a non-validating SQL parser module for Python, prior to version 0.6.0 contains a flaw in the group_comments function in sqlparse/engine/grouping.py, which rescans comment-only statements before a size guard is applied, causing quadratic CPU consumption when parsing with sqlparse.parse() or sqlparse.format() with strip_comments enabled. An attacker able to supply crafted SQL input to an application that parses it with these functions can exhaust CPU resources, with no authentication, user interaction or special configuration required beyond that use.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:01:11Z"},"euvd":{"id":"EUVD-2026-60309","exploited":false,"provenance":"source"}}