CVE-2026-59893: sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service)
sqlparse is a non-validating SQL parser module for Python. Prior to 0.6.0, SQLREGEX 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
sqlparseto a version that resolves this vulnerability.Fixed in 0.6.0
Event History
Frequently Asked Questions
What is the severity of CVE-2026-59893?
The severity of CVE-2026-59893 is rated high with a score of 7.5.
How do I fix CVE-2026-59893?
To fix CVE-2026-59893, update sqlparse to version 0.6.0 or later.
What type of vulnerability is CVE-2026-59893?
CVE-2026-59893 is a denial of service vulnerability caused by inefficient regex handling.
Which software is affected by CVE-2026-59893?
CVE-2026-59893 affects the sqlparse library available on PyPI.
What causes the vulnerability CVE-2026-59893?
The vulnerability is caused by repeated scanning of unmatched dollar-quoted literal and multiline-comment delimiters in sqlparse.