CVE-2026-59893
Received Received - Intake

Denial of Service in sqlparse via Quadratic CPU Consumption

Vulnerability report for CVE-2026-59893, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-17

Last updated on: 2026-08-17

Assigner: GitHub, Inc.

Description

sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, SQL_REGEX in sqlparse/keywords.py and the per-position loop in sqlparse/lexer.py repeatedly scan unmatched dollar-quoted literal and multiline-comment delimiters, causing quadratic CPU consumption through sqlparse.parse(), sqlparse.format(), and sqlparse.split(). This issue is fixed in version 0.6.0.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-17
Last Modified
2026-08-17
Generated
2026-08-17
AI Q&A
2026-08-17
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 4 associated CPEs
Vendor Product Version / Range
andialbrecht sqlparse 0.6.0
andialbrecht sqlparse to 0.6.0 (exc)
andialbrecht sqlparse to 0.5.6.dev0 (exc)
sqlparse sqlparse to 0.6.0 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-1333 The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This is a ReDoS (Regular Expression Denial of Service) vulnerability in the sqlparse library affecting versions prior to 0.6.0. It involves inefficient regex patterns in the lexer that cause quadratic CPU consumption when processing crafted SQL inputs with many unmatched dollar-quoted literals or multiline comments. The regex uses lazy quantifiers or backreferences, forcing the lexer to repeatedly scan the entire input for each unmatched opener, leading to excessive resource usage.

Detection Guidance

To detect this vulnerability, check the installed version of sqlparse using pip show sqlparse. If the version is below 0.6.0, the system is vulnerable. Monitor CPU usage spikes when processing SQL inputs, as this may indicate exploitation attempts.

Impact Analysis

An attacker can exploit this by sending crafted SQL text to any application using sqlparse, causing sustained CPU exhaustion and denial of service. This can degrade or block service availability with minimal input size. The vulnerability requires no authentication or special privileges and can be triggered remotely.

Compliance Impact

This vulnerability primarily causes denial-of-service through CPU exhaustion, which could impact availability of systems processing SQL input. While not directly violating GDPR or HIPAA, prolonged unavailability of systems handling personal health or user data could lead to compliance issues under those regulations due to potential disruptions in data access or processing.

Mitigation Strategies

Immediately upgrade sqlparse to version 0.6.0 or later using pip install --upgrade sqlparse. If upgrading is not possible, restrict user input to trusted SQL sources and implement rate limiting on SQL processing requests to reduce exposure.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-59893. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart