SQL Parsing Performance Degradation in sqlparse Package - CVE-2026-84305

sqlparse Updated 02 Sep 2026

Summary

01/09/2026
N/A
No i
Unrated
Not published

DEBIAN-CVE-2026-84305: sqlparse is a non-validating SQL parser module for Python. Affects sqlparse versions 0.4.2-1 – 0.5.5-2. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

sqlparse is a non-validating SQL parser module for Python, widely used for parsing SQL statements. It allows developers to format and manipulate SQL queries easily. However, prior to version 0.6.0, sqlparse had a significant performance vulnerability that could lead to excessive CPU consumption under certain conditions.

Vulnerability Detail

The vulnerability arises from the way sqlparse handles parenthesized tuple lists during formatting. When using the sqlparse.format function with the reindent option enabled, the method ReindentFilter._get_offset() can be exploited. Specifically, the _flatten_up_to_token() function repeatedly rebuilds and joins the statement prefix, leading to thousands of offset calculations that traverse an expanding token tree. This results in quadratic CPU consumption, causing request delays, reduced throughput, or even worker starvation, especially with inputs that remain below the MAX_GROUPING_TOKENS threshold.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, avoid using the reindent option in sqlparse.format or refrain from processing large parenthesized tuple lists until the package is updated to the patched version.

Conclusion

The sqlparse package has a critical vulnerability (CVE-2026-84305) that can lead to performance issues due to inefficient SQL formatting. Users are advised to update to version 0.6.0 or later to mitigate this risk. For those unable to update immediately, a temporary workaround is available.

See every vulnerability recorded for sqlparse →

Share this vulnerability

FAQ

CVE-2026-84305 is a vulnerability in the sqlparse package that can lead to excessive CPU consumption due to inefficient handling of SQL formatting.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to analyze your manifest file.

The vulnerability can cause significant performance degradation, leading to request delays and reduced application throughput, which may affect user experience.

Yes, the vulnerability is fixed in sqlparse version 0.6.0 and later. It is recommended to update to this version to mitigate the issue.

If an immediate update is not possible, consider avoiding the use of the reindent option in sqlparse.format as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for sqlparse.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback