Vulnerability · Published Sep 1, 2026 · Assigned by GitHub_M

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

Medium 5.1

In plain English

A medium-severity security flaw in sqlparse from andialbrecht. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 9% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)5.1Medium
Exploit odds (30 days)0.2%top 91.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12sqlparseno fix listedDEBIAN-CVE-2026-84305
Debian:13sqlparseno fix listedDEBIAN-CVE-2026-84305
Debian:14sqlparseno fix listedDEBIAN-CVE-2026-84305
PyPIsqlparse0.6.0GHSA-cfqr-cjx5-5jcm
PyPIsqlparse0.6.0PYSEC-2026-3923
Ubuntu:22.04:LTSsqlparseno fix listedUBUNTU-CVE-2026-84305
Ubuntu:24.04:LTSsqlparseno fix listedUBUNTU-CVE-2026-84305
Ubuntu:26.04:LTSsqlparseno fix listedUBUNTU-CVE-2026-84305
Ubuntu:26.10sqlparseno fix listedUBUNTU-CVE-2026-84305

Affected products (as reported)

VendorProductVersions
andialbrecht sqlparse < 0.6.0

Weakness: CWE-407 · Vector: 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

References