CVE-2026-59893
Description
A flaw was found in sqlparse, a Python module for parsing SQL. A remote attacker could exploit this vulnerability by providing specially crafted SQL input. This flaw causes inefficient processing of certain SQL patterns, leading to excessive CPU consumption and potentially a Denial of Service (DoS) condition, making the application unresponsive.
Statement
An IMPORTANT severity flaw was found in sqlparse, a non-validating SQL parser module for Python that is bundled as a dependency in numerous Red Hat products and container images. The SQL_REGEX definitions in sqlparse/keywords.py and the per-position scanning loop in sqlparse/lexer.py repeatedly re-scan unmatched dollar-quoted literal and multiline-comment delimiters, causing quadratic CPU consumption when input is processed through sqlparse.parse(), sqlparse.format(), or sqlparse.split(). A remote attacker who can supply specially crafted SQL input to an application that passes that input to sqlparse can cause excessive CPU consumption, making the application unresponsive and resulting in a denial of service. Red Hat rates this flaw as IMPORTANT with a CVSS 3.1 score of 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H), which matches the upstream severity. Almost all in-scope Red Hat components that ship an affected version of sqlparse are recorded as affected, and fixes are being pursued through the responsible product teams; a small number of components have been evaluated as not affected.
Mitigation
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability. The upstream project addressed this issue in sqlparse 0.6.0, and Red Hat products that bundle sqlparse will receive remediation through their respective update streams as fixes become available.
Common Vulnerability Scoring System (CVSS) Score Details
Info alert:Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).
CVSS v3 Score Breakdown
| Red Hat | NVD | cve.org | |
|---|---|---|---|
| Base Score | 7.5 | N/A | 7.5 |
| Attack Vector | Network | N/A | Network |
| Attack Complexity | Low | N/A | Low |
| Privileges Required | None | N/A | None |
| User Interaction | None | N/A | None |
| Scope | Unchanged | N/A | Unchanged |
| Confidentiality | None | N/A | None |
| Integrity Impact | None | N/A | None |
| Availability Impact | High | N/A | High |
Vector
Red Hat: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
cve.org: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Understanding the Weakness (CWE)
Availability
Technical Impact: DoS: Resource Consumption (CPU)
Attackers can create crafted inputs that intentionally cause the regular expression to use excessive backtracking in a way that causes the CPU consumption to spike.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.