CVE-2026-59893
High · 7.5CVSS
7.5
EPSS
0.3%
Published
Aug 17, 2026
CISA due date
—
Cloudanix analysis
A flaw in a Python SQL parsing library lets an attacker send specially crafted text that makes the program use far more processing power than expected, potentially slowing or stopping services that rely on it.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Repeated linear scans over unmatched dollar-quoted literals and multiline comment delimiters in SQL_REGEX and the lexer position loop produce quadratic CPU usage when sqlparse.parse, format, or split are called on crafted input.
Why it matters to the business
Applications that parse untrusted SQL can experience sudden CPU exhaustion, leading to service slowdowns or outages; the Red Hat package requires the RHSA-2026:61783 update and has been exposed for 70 days.
How an attack unfolds
An attacker supplies a single SQL string containing a large number of unmatched dollar-quote or comment delimiters; each call to the parser triggers repeated rescanning of the same prefixes, driving CPU to 100% and denying service to legitimate requests.
How to fix it
Upgrade sqlparse to version 0.6.0 or later; for Red Hat systems apply the server-rhel9:1788205779 update referenced in RHSA-2026:61783.
How to confirm the fix worked
Confirm the installed sqlparse version is 0.6.0 or newer; run a benchmark with a crafted payload containing 10 000 unmatched dollar quotes and verify CPU time remains linear.
Typical attack path
- Identify an entry point that invokes sqlparse.parse, format, or split on attacker-controlled SQL.
- Craft input containing thousands of unmatched dollar-quoted or multiline-comment delimiters.
- Submit the payload to trigger the quadratic loop in lexer.py.
- Observe sustained high CPU usage and service degradation or crash.
How to detect it
Monitor process CPU and memory metrics for sudden spikes correlated with sqlparse calls; review application logs for parse/format/split operations on unusually long or malformed SQL strings.
What your security team should do
- Apply the Red Hat RHSA-2026:61783 update or upgrade sqlparse to 0.6.0 within 30 days.
- Add dependency pinning and automated scanning to prevent future vulnerable versions from being introduced.
- Review any code paths that parse SQL originating from external or user-controlled sources.
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-121577 Inefficient Regular Expression Complexity (CWE-1333) in generate_regex()… CWE-1333
- CVE-2026-120217 A vulnerability was detected in Delgan loguru 0.7.3. CWE-1333
- CVE-2026-62864 Ring is a Clojure web applications library inspired by Python's WSGI and Ruby's Rack. CWE-1333
- CVE-2026-119300 Wekan is open source kanban built with Meteor. CWE-1333
- CVE-2026-118993 CallBackery versions before 0.62.0 for Perl allow denial of service via the request path… CWE-1333
- CVE-2026-115866 Starlet versions from 0.20 before 0.33 for Perl allow CPU exhaustion via regular… CWE-1333
- CVE-2026-119202 @hapi/content provides HTTP Content-* header parsing. CWE-1333
- CVE-2026-118779 Forge (also called node-forge) is a native implementation of Transport Layer Security in… CWE-1333