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

> An attacker can cause excessive CPU consumption and service delays by submitting crafted SQL inputs to the sqlparse library's reindentation feature.

- **Severity:** Medium 5.1 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Sep 2026
- **Updated:** 1 Sep 2026
- **Also known as:** CLEANSTART-2026-JF73384, CLEANSTART-2026-UP48732, CLEANSTART-2026-WG08246, DEBIAN-CVE-2026-84305, ECHO-8e2d-935c-d158, GHSA-cfqr-cjx5-5jcm, MINI-6q58-vh7v-3vv9, MINI-8994-337c-jvx2, MINI-mpwm-6vhq-9r7j, MINI-vh4f-qm67-hmjr, MINI-vp6h-fq53-g35j, PYSEC-2026-3923, SUSE-SU-2026:23634-1, SUSE-SU-2026:3978-1, SUSE-SU-2026:4109-1, SUSE-SU-2026:4145-1, UBUNTU-CVE-2026-84305, openSUSE-SU-2026:21777-1

## What is CVE-2026-84305?

CVE-2026-84305 is a medium-severity denial of service vulnerability in andialbrecht sqlparse, published on 1 Sep 2026. It can only be exploited from the same machine or local network, with no action from the victim.

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

Weakness: CWE-407 (Inefficient Algorithmic Complexity)

## Which versions are affected by CVE-2026-84305?

3 open source packages ship an affected version, including sqlparse.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sqlparse` | PyPI | All versions | 0.6.0 |
| `sqlparse` | PyPI | All versions | 0.6.0 |
| `sqlparse` | PyPI | All versions | 0.6.0 |
| `python-sqlparse` | SUSE:Linux Enterprise Module for Package Hub 15 SP7 | All versions | 0.2.4-150100.6.14.1 |
| `python-sqlparse` | SUSE:Linux Enterprise Module for Public Cloud 15 SP4 | All versions | 0.4.4-150400.6.19.1 |
| `python-sqlparse` | SUSE:Linux Enterprise Module for Public Cloud 15 SP5 | All versions | 0.4.4-150400.6.19.1 |
| `python-sqlparse` | SUSE:Linux Enterprise Module for Public Cloud 15 SP6 | All versions | 0.4.4-150600.3.12.1 |
| `python-sqlparse` | SUSE:Linux Enterprise Module for Python 3 15 SP7 | All versions | 0.4.4-150600.3.12.1 |
| `python-sqlparse` | SUSE:Linux Enterprise Server 16.0 | All versions | 0.5.3-160000.5.1 |
| `python-sqlparse` | SUSE:Linux Enterprise Server for SAP applications 16.0 | All versions | 0.5.3-160000.5.1 |
| `python-sqlparse` | openSUSE:Leap 16.0 | All versions | 0.5.3-160000.5.1 |

## How do I fix CVE-2026-84305?

Upgrade sqlparse to 0.6.0 or later.

## Is CVE-2026-84305 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-84305 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-84305 and fix it if it is affected.

What it is: CVE-2026-84305 is a medium-severity denial of service vulnerability in andialbrecht sqlparse, published on 1 Sep 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-84305 exists.

Affected packages and fixed versions:
- sqlparse (PyPI): affected all versions; fixed in 0.6.0
- sqlparse (PyPI): affected all versions; fixed in 0.6.0
- sqlparse (PyPI): affected all versions; fixed in 0.6.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-84305/ (Markdown: https://insights.sbomify.com/CVE-2026-84305/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-84305
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-84305
- OSV: https://osv.dev/vulnerability/CVE-2026-84305

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-84305/
Summaries are generated and may contain mistakes; the official description above is the record.
