CVE-2026-84305: CWE-407: Inefficient Algorithmic Complexity in andialbrecht sqlparse
Description
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.
CVSS v4.0
Score 5.1medium
Affected software
andialbrecht
sqlparse
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The sqlparse Python module before version 0.6.0 contains an inefficient algorithmic complexity vulnerability (CWE-407) in the sqlparse.format(sql, reindent=True) function and the sqlformat --reindent command. Specifically, attacker-controlled parenthesized tuple lists are routed through ReindentFilter._get_offset(), where the _flatten_up_to_token() function repeatedly rebuilds and joins the statement prefix. This results in thousands of offset calculations walking an expanding token tree, producing quadratic CPU consumption for inputs below MAX_GROUPING_TOKENS. The vulnerability can cause request delays, reduced throughput, or worker starvation. The issue is resolved in sqlparse version 0.6.0.
Potential Impact
The vulnerability causes excessive CPU usage due to quadratic time complexity in processing certain SQL inputs, which can degrade service performance by causing delays, reduced throughput, or worker starvation. There is no indication of privilege escalation, data leakage, or remote code execution. The impact is primarily a denial of service through resource exhaustion.
Mitigation Recommendations
A fix is available in sqlparse version 0.6.0. Users should upgrade to version 0.6.0 or later to remediate this vulnerability. No other mitigation or temporary workaround is indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-09-01T16:17:43.078Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a971b7aacd9273b490f4b62
Added to database: 09/01/2026, 18:37:46 UTC
Last enriched: 09/07/2026, 14:22:24 UTC
Last updated: 10/14/2026, 18:48:24 UTC
Views: 93
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.