Read the docs
TI-2026-57940 Aliases CVE-2026-84305GHSA-cfqr-cjx5-5jcm

sqlparse: Reindentation of tuple lists causes near-cap quadratic CPU consumption

Priority MEDIUM 56CWE-407Published · Updated

Key facts

Attack vector
Local
Privileges required
None
User interaction
None
Attack complexity
Low
Attack requirements
None
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · Low
Fix status
Partial Red Hat: 3 without a fix

Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-407.

Summary

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00189 8th percentileScored 2026-11-07
Fix Partial sqlparse (andialbrecht): 0.6.0sqlparse (PyPI): 0.6.0Red Hat: 3 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
andialbrechtsqlparsebefore 0.6.00.6.0Patch availableCNA
—sqlparse (PyPI)before 0.6.00.6.0Patch availableGHSA-cfqr-cjx5-5jcm
  • sqlparse Vendorandialbrecht Affected before 0.6.0 Fixed in 0.6.0 Patch available CNA
  • sqlparse (PyPI) Vendor— Affected before 0.6.0 Fixed in 0.6.0 Patch available GHSA-cfqr-cjx5-5jcm

Remediation

  • Fix · CNA sqlparse (andialbrecht) Fixed in 0.6.0
  • Fix · GHSA-cfqr-cjx5-5jcm sqlparse (PyPI) Fixed in 0.6.0 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Moderate. Red Hat's page for this CVE →

ProductStatusPlan or fix
Red Hat OpenStack Platform 16.2Affected—
Red Hat OpenStack Platform 17.1Affected—
Red Hat OpenStack Platform 18.0Affected—
Not affected: 2 products
  • Red Hat OpenStack Platform 13 (Queens)
  • Red Hat OpenStack Platform 16.2

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-84305
  2. 2026-10-03 Alias added: GHSA-cfqr-cjx5-5jcm
  3. 2026-10-05 Affected versions changed · Red Hat
  4. 2026-10-05 CVSS score added · Red Hat

References

  • TI-2026-39184 sqlparse: TokenList.__init__ materializes O(subtree) value per group, causing CPU DoS before depth/token caps trigger CVSS 4.0HIGH 8.7
  • TI-2026-42707 sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service) CVSS 3.1HIGH 7.5
  • TI-2026-50099 sqlparse: Quadratic O(n²) DoS in group_comments CVSS 4.0HIGH 8.7
  • TI-2026-76501 PHP code injection in sqlparse via output_format='php' CVSS 4.0HIGH 8.4
  • TI-2026-42708 sqlparse: Generated Python and PHP snippets allow SQL string breakout through unescaped backslashes CVSS 4.0MEDIUM 6.2

Sources