CVE-2026-71491
HIGH 8.7CVSS 4.0sqlparse: Quadratic O(n²) DoS in group_comments
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.
- Published
- 17 Aug 2026
- Last modified
- 23 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Deferred
- Weakness
- CWE-400CWE-407
- Also known as
- GHSA-f2ff-p2ww-7p4pPYSEC-2026-3697
- Sources
- NVDJSONOSV GHSA-f2ff-p2ww-7p4pJSONOSV PYSEC-2026-3697JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | HIGH 8.7 | 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | 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 | |
| OSV | PyPA | CVSS 4.0 | 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 |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | PyPI | sqlparse | < 0.6.0 | 0.6.0 |
References
- https://github.com/andialbrecht/sqlparse/commit/ef2012a5eeb491e604dea2b00d516904a3830c87 · WEB
- https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-f2ff-p2ww-7p4p · WEB
- https://github.com/andialbrecht/sqlparse · PACKAGE
- https://pypi.org/project/sqlparse · PACKAGE
- https://github.com/advisories/GHSA-f2ff-p2ww-7p4p · ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2026-71491 · ADVISORY
History
- 25 Nov 2026 21:04 UTC · NVD: first stored (published 17 Aug 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 19 Aug 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 17 Aug 2026)