Vulnerability · Published Aug 17, 2026 · Assigned by GitHub_M

CVE-2026-59893sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service)

High 7.5

In plain English

A high-severity regular-expression denial of service in sqlparse from andialbrecht. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 27% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)0.3%top 72.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12sqlparseno fix listedDEBIAN-CVE-2026-59893
Debian:13sqlparseno fix listedDEBIAN-CVE-2026-59893
Debian:14sqlparseno fix listedDEBIAN-CVE-2026-59893
PyPIsqlparse0.6.0PYSEC-2026-3698
PyPIsqlparse0.6.0GHSA-prg7-hcfm-mfcr
Ubuntu:22.04:LTSsqlparse0.4.2-1ubuntu0.22.04.3UBUNTU-CVE-2026-59893
Ubuntu:22.04:LTSsqlparse0.4.2-1ubuntu0.22.04.3USN-8808-1
Ubuntu:24.04:LTSsqlparse0.4.4-1ubuntu0.2USN-8808-1
Ubuntu:24.04:LTSsqlparse0.4.4-1ubuntu0.2UBUNTU-CVE-2026-59893
Ubuntu:26.04:LTSsqlparse0.5.4-1ubuntu0.1USN-8808-1
Ubuntu:26.04:LTSsqlparse0.5.4-1ubuntu0.1UBUNTU-CVE-2026-59893

Affected products (as reported)

VendorProductVersions
andialbrecht sqlparse < 0.6.0

Weakness: CWE-1333 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References