Inefficient Algorithmic Complexity in Sqlparse - CVE-2026-54284

 

Inefficient Algorithmic Complexity in Sqlparse - CVE-2026-54284

Published: August 13, 2026


Vulnerability identifier: #VU142416
CSH Severity: Medium
CVSS v4: 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]
CVE-ID: CVE-2026-54284
CWE-ID: CWE-407
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to cause a denial of service.

The vulnerability exists due to inefficient algorithmic complexity in TokenList.__init__ when parsing attacker-supplied SQL with deeply nested grouping constructs. A remote attacker can send a specially crafted SQL input to cause a denial of service.

The issue is reachable through the default sqlparse.parse, sqlparse.format, and sqlparse.split entry points, and nested parentheses, nested CASE WHEN expressions, nested subqueries, or nested ARRAY[] literals can trigger excessive CPU consumption before parser depth and token caps raise an error.


Affected software

Sqlparse

How to mitigate CVE-2026-54284

Install security update from vendor's website.

Sqlparse - update to 0.6.0

External References

Related Security Bulletins