Skip to main content
EPSS 0.2%top 92%

CVE-2026-84305: CWE-407: Inefficient Algorithmic Complexity in andialbrecht sqlparse

0
Medium
Published: 09/01/2026 (09/01/2026, 18:33:10 UTC)
Source: CVE Database V5
Vendor/Project: andialbrecht
Product: 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

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Affected software

andialbrecht

sqlparse

Affected versions
<0.6.0

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/07/2026, 14:22:24 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses