{"id":"CVE-2026-59893","published":"2026-08-17T17:41:36Z","modified":"2026-08-17T18:54:26Z","title":"sqlparse: Inefficient Regex Handling of Dollar-Quoted SQL Literals Leads to ReDoS (Denial of Service)","vendor":"andialbrecht","product":"sqlparse","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00337,"percentile":0.27789,"provenance":"source"},"cwes":[{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity"}],"references":[{"url":"https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-prg7-hcfm-mfcr","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/andialbrecht/sqlparse/commit/d1d80602741f77ec78e5a04ce4719244cf32352e","tags":["x_refsource_MISC"]}],"priority":{"score":10.8,"factors":[{"name":"EPSS percentile","points":5.56},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"andialbrecht","affectedVersions":[{"vendor":"andialbrecht","product":"sqlparse","versions":["< 0.6.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-08-17T18:54:17.365983Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"sqlparse","vulnerableRanges":["<0.6.0"],"patched":["0.6.0"],"from":["GHSA-prg7-hcfm-mfcr","PYSEC-2026-3698"],"provenance":"source"}],"summary":{"text":"The flaw is an inefficient regular expression handling issue in sqlparse, a Python non-validating SQL parser, in its SQL_REGEX pattern (sqlparse/keywords.py) and the per-position loop in sqlparse/lexer.py, which repeatedly rescan unmatched dollar-quoted literal and multiline-comment delimiters. An attacker with network access and no authentication or user interaction can supply crafted SQL input to applications that call sqlparse.parse(), sqlparse.format(), or sqlparse.split(), causing quadratic CPU consumption that results in denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:57:51Z"},"euvd":{"id":"EUVD-2026-60311","exploited":false,"provenance":"source"}}