High CPU Consumption Vulnerability in sqlparse Package

sqlparse Updated 18 Aug 2026

Summary

17/08/2026
N/A
No i
High
7.5

DEBIAN-CVE-2026-59893: 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

sqlparse is a non-validating SQL parser module for Python, widely used for parsing SQL statements. It provides functionalities such as formatting and splitting SQL queries, making it a valuable tool for developers working with databases. However, prior to version 0.6.0, sqlparse had a significant vulnerability that could lead to excessive CPU usage under certain conditions.

Vulnerability Detail

The vulnerability arises from the SQL_REGEX in sqlparse/keywords.py and the per-position loop in sqlparse/lexer.py, which repeatedly scan unmatched dollar-quoted literal and multiline-comment delimiters. This results in quadratic CPU consumption when using functions like sqlparse.parse(), sqlparse.format(), and sqlparse.split(). If exploited, this could lead to performance degradation and denial of service, especially in applications that handle large or complex SQL queries.

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, you can limit the complexity of SQL queries being processed or avoid using dollar-quoted literals and multiline comments until the package is updated. This may help reduce CPU consumption in the interim.

Conclusion

The sqlparse package has a critical vulnerability that can lead to high CPU consumption, affecting application performance. It is essential 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

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

All versions prior to 0.6.0 are affected by this vulnerability.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. By utilizing the Vulert playground, you can check if your application is affected without any signup.

The vulnerability can lead to excessive CPU consumption, resulting in performance issues and potential denial of service in applications that utilize sqlparse.

Yes, you can limit the complexity of SQL queries processed by sqlparse or avoid using dollar-quoted literals and multiline comments as a temporary measure.

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