High CPU Consumption Vulnerability in sqlparse Package

sqlparse Updated 18 Aug 2026

Summary

17/08/2026
N/A
No i
Unrated
Not published

DEBIAN-CVE-2026-71491: sqlparse is a non-validating SQL parser module for Python. Affects sqlparse versions 0.4.1-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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

sqlparse is a non-validating SQL parser module for Python, widely used for parsing SQL statements in various applications. It provides functionalities to format and analyze SQL queries, making it a popular choice among developers. However, prior to version 0.6.0, sqlparse contained a significant vulnerability that could lead to excessive CPU usage when processing certain SQL statements.

Vulnerability Detail

The vulnerability arises from the group_comments function in sqlparse/engine/grouping.py, which repeatedly rescans comment-only statements before the MAX_GROUPING_TOKENS guard. This flaw can lead to quadratic CPU consumption when using sqlparse.parse() or sqlparse.format(sql, strip_comments=True) on affected SQL statements. As a result, applications utilizing sqlparse may experience performance degradation, potentially leading to denial of service under heavy load.

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

If immediate upgrading is not feasible, a temporary workaround is to avoid using sqlparse on SQL statements that are comment-only or to limit the use of the parse and format functions until the package can be updated.

Conclusion

The sqlparse package has a vulnerability that can lead to high CPU consumption due to inefficient handling of comment-only SQL statements. It is crucial to update to version 0.6.0 or later to mitigate this risk. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert.

See every vulnerability recorded for sqlparse →

Share this vulnerability

FAQ

All versions prior to 0.6.0 are affected by this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities. By using the Vulert playground, you can check if your application is affected without any signup.

The vulnerability can lead to excessive CPU consumption, potentially causing performance issues or denial of service in applications that rely on sqlparse.

Yes, you can temporarily avoid using sqlparse on comment-only SQL statements or limit the use of its parse and format functions until an update is performed.

You can find more information about sqlparse on its official documentation or repository, which provides details on its features and usage.

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