CVE-2026-71491
published high CVSS 4.0 · 8.7sqlparse: Quadratic O(n²) DoS in group_comments
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| andialbrecht | — | sqlparse< 0.6.0 | Affected | Not stated | GitHub_M |
| Ubuntu | bionic | sqlparse | Advisory build | 0.2.4-0.1ubuntu0.1+esm1 | USN-8808-1 |
| SUSE / openSUSE | SLE-15-SP4 | python3-sqlparsenoarch | Advisory build | 0.4.2-150300.23.1 | SUSE-SU-2026:3906-1 |
| Ubuntu | focal | sqlparse | Advisory build | 0.2.4-3ubuntu0.1+esm1 | USN-8808-1 |
| Ubuntu | jammy | sqlparse | Advisory build | 0.4.2-1ubuntu0.22.04.3 | USN-8808-1 |
| Ubuntu | noble | sqlparse | Advisory build | 0.4.4-1ubuntu0.2 | USN-8808-1 |
| Ubuntu | resolute | sqlparse | Advisory build | 0.5.4-1ubuntu0.1 | USN-8808-1 |
| Ubuntu | xenial | sqlparse | Advisory build | 0.1.18-1ubuntu0.1~esm1 | USN-8808-1 |
Show 36 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | SLE-15-SP4 | python311-sqlparsenoarch | Advisory build | 0.4.4-150400.6.16.1 | SUSE-SU-2026:3910-1 |
| SUSE / openSUSE | SLE-15-SP5 | python3-sqlparsenoarch | Advisory build | 0.4.2-150300.23.1 | SUSE-SU-2026:3906-1 |
| SUSE / openSUSE | SLE-15-SP5 | python311-sqlparsenoarch | Advisory build | 0.4.4-150400.6.16.1 | SUSE-SU-2026:3910-1 |
| SUSE / openSUSE | SLE-15-SP6 | python3-sqlparsenoarch | Advisory build | 0.4.2-150300.23.1 | SUSE-SU-2026:3906-1 |
| SUSE / openSUSE | SLE-15-SP6 | python311-sqlparsenoarch | Advisory build | 0.4.4-150600.3.9.1 | SUSE-SU-2026:3907-1 |
| SUSE / openSUSE | SLE-15-SP7 | python2-sqlparsenoarch | Advisory build | 0.2.4-150100.6.11.1 | SUSE-SU-2026:3762-1 |
| SUSE / openSUSE | SLE-15-SP7 | python3-sqlparsenoarch | Advisory build | 0.4.2-150300.23.1 | SUSE-SU-2026:3906-1 |
| SUSE / openSUSE | SLE-15-SP7 | python311-sqlparsenoarch | Advisory build | 0.4.4-150600.3.9.1 | SUSE-SU-2026:3907-1 |
| SUSE / openSUSE | SLE-16 | python313-sqlparsenoarch | Advisory build | 0.5.3-160000.4.1 | SUSE-SU-2026:23561-1 |
| SUSE / openSUSE | SLE-3-SP7 | python311-sqlparsenoarch | Advisory build | 0.4.4-150600.3.9.1 | SUSE-SU-2026:3907-1 |
| SUSE / openSUSE | openSUSE-Leap-16.0 | python313-sqlparsenoarch | Advisory build | 0.5.3-160000.4.1 | OPENSUSE-SU-2026:21690-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparseaarch64 | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparseppc64le | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparses390x | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-sqlparsex86_64 | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparseaarch64 | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparseppc64le | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparses390x | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-sqlparsex86_64 | Advisory build | 0.6.0-1.1 | OPENSUSE-SU-2026:11557-1 |
| Ubuntu | bionic | pypy-sqlparse | Advisory build | 0.2.4-0.1ubuntu0.1+esm1 | USN-8808-1 |
| Ubuntu | bionic | python-sqlparse | Advisory build | 0.2.4-0.1ubuntu0.1+esm1 | USN-8808-1 |
| Ubuntu | bionic | python3-sqlparse | Advisory build | 0.2.4-0.1ubuntu0.1+esm1 | USN-8808-1 |
| Ubuntu | bionic | sqlformat | Advisory build | 0.2.4-0.1ubuntu0.1+esm1 | USN-8808-1 |
| Ubuntu | focal | pypy-sqlparse | Advisory build | 0.2.4-3ubuntu0.1+esm1 | USN-8808-1 |
| Ubuntu | focal | python3-sqlparse | Advisory build | 0.2.4-3ubuntu0.1+esm1 | USN-8808-1 |
| Ubuntu | focal | sqlformat | Advisory build | 0.2.4-3ubuntu0.1+esm1 | USN-8808-1 |
| Ubuntu | jammy | python3-sqlparse | Advisory build | 0.4.2-1ubuntu0.22.04.3 | USN-8808-1 |
| Ubuntu | jammy | sqlformat | Advisory build | 0.4.2-1ubuntu0.22.04.3 | USN-8808-1 |
| Ubuntu | noble | python3-sqlparse | Advisory build | 0.4.4-1ubuntu0.2 | USN-8808-1 |
| Ubuntu | noble | sqlformat | Advisory build | 0.4.4-1ubuntu0.2 | USN-8808-1 |
| Ubuntu | resolute | python3-sqlparse | Advisory build | 0.5.4-1ubuntu0.1 | USN-8808-1 |
| Ubuntu | resolute | sqlformat | Advisory build | 0.5.4-1ubuntu0.1 | USN-8808-1 |
| Ubuntu | xenial | pypy-sqlparse | Advisory build | 0.1.18-1ubuntu0.1~esm1 | USN-8808-1 |
| Ubuntu | xenial | python-sqlparse | Advisory build | 0.1.18-1ubuntu0.1~esm1 | USN-8808-1 |
| Ubuntu | xenial | python3-sqlparse | Advisory build | 0.1.18-1ubuntu0.1~esm1 | USN-8808-1 |
| Ubuntu | xenial | sqlformat | Advisory build | 0.1.18-1ubuntu0.1~esm1 | USN-8808-1 |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 8.7 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- 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
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| andialbrecht | sqlparse | < 0.6.0 (affected) | GitHub_M · cna |
Weaknesses
2- CWE-400 CWE-400: Uncontrolled Resource Consumption
- CWE-407 CWE-407: Inefficient Algorithmic Complexity
References
2Provider assertions
2GitHub_M · cna
sqlparse: Quadratic O(n²) DoS in group_comments
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- cb485a844deb60c8a2e186f78d195c28b38cd0af62d9253cabb25f0dd93a465d
- Ingested
- 23 Sep 2026, 09:29:33 UTC
- Source record
- Official CVE record