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

- Priority: **Prioritise**
- Reason: Severe, CVSS 7.5 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 0% (FIRST, 04-12-2026)
- Next step: Check applicability: affected before 0.6.0 (CNA); fix release not confirmed
- Status: published
- Published: 2026-08-17 · Modified: 2026-08-17
- Aliases: GHSA-prg7-hcfm-mfcr, PYSEC-2026-3698, UBUNTU-CVE-2026-59893, DEBIAN-CVE-2026-59893, CGA-2f64-f3m8-4x86, CGA-3r75-crvj-7pr8, CGA-4jr3-2qq7-4hpr, CGA-4vr4-7x2f-m42r, CGA-7h7p-cg22-pjhv, CGA-9xf9-wrvv-v9fj, CGA-f674-ccg5-r9x9, CGA-gm48-rjq5-2mg8, CGA-m432-7vfg-wccv, CGA-2252-4587-3p65, CGA-27rw-xjj3-mv92, CGA-28c5-7gm7-c8jj, CGA-2x62-7gc5-wc3p, CGA-36f7-3mv3-5wp5, CGA-3q3h-3r6v-c5pq, CGA-3r32-5w3r-f7m2, CGA-46v9-7h93-x3m8, CGA-48mj-7v4f-f9vf, CGA-4qch-c6h5-qcrr, CGA-4qjv-9wch-x563, CGA-4rw4-x32m-q4c8, CGA-5c5q-chrh-gxpj, CGA-5jc7-grmh-ccj7, CGA-5q5h-f2h6-xxfg, CGA-662x-4224-9382, CGA-66hr-m9hr-8crq, CGA-66qp-fxqx-qgx9, CGA-68q9-5fv6-c4m2, CGA-6p9v-hx3m-mm2j, CGA-6pq5-5472-8qfm, CGA-6rf2-p8gm-qfmm, CGA-6rqp-84wj-r6f6, CGA-6x62-rm5p-c7xj, CGA-7f82-cc7h-vf73, CGA-7gf8-vpjv-88rr, CGA-7jgv-4mh9-q4vh, CGA-8249-58cf-3mjf, CGA-84w9-27r7-p25p, CGA-87jw-979g-984j, CGA-8gg4-j6w4-98r6, CGA-8ghp-x4hc-6m3q, CGA-8v8j-x7q6-8r7p, CGA-8vx8-m84q-4f98, CGA-9344-3vx5-wmgh, CGA-93c3-3r3m-j295, CGA-958r-p35q-xhp5, CGA-98xw-qwwr-hxf5, CGA-994v-hph8-9rch, CGA-99rf-c6f2-8m9q, CGA-9fgj-qmf5-mwhg, CGA-9h77-8mh4-vq43, CGA-9w9f-gh25-j4qc, CGA-c7p8-pqww-r2wc, CGA-c95c-4v2m-36v6, CGA-cf8r-x2qj-vqh7, CGA-cghm-6jqr-vq3w, CGA-ch8j-gc25-25q4, CGA-cmmw-v5x5-4h7h, CGA-cmxx-rrgc-g66v, CGA-cp9x-7hrc-3fw7, CGA-cq55-4g28-36cp, CGA-f223-8w2c-m5x3, CGA-f26q-9q84-mqg9, CGA-f5pf-9xmv-88fw, CGA-fghg-r56c-4hcx, CGA-fgwp-vp33-4m97, CGA-fj67-4w3w-xfgh, CGA-fm8j-g5pw-2q4f, CGA-fpm7-2pgp-9pqm, CGA-g4hv-qhw8-9wqp, CGA-g5x3-4x5x-779q, CGA-g6rf-9c63-26r4, CGA-g7m6-8gqh-gqmc, CGA-ggjg-hhjx-hwx5, CGA-gwhm-7g3r-w3qj, CGA-h27g-42r2-j2gf, CGA-hrr5-mxjg-jrgp, CGA-j465-6qxj-4fhx, CGA-j63w-8j44-xg2p, CGA-j6pw-p22g-ggm2, CGA-jqrw-265x-wvhj, CGA-jr6h-f9jc-4v96, CGA-jv2v-2qch-6wpm, CGA-jxh5-mg39-ghm2, CGA-m265-fw4h-mc46, CGA-m8v9-5x98-38f4, CGA-mq7c-jc3p-q5wr, CGA-mvrq-52j6-c24p, CGA-p45g-jh26-jrg4, CGA-p8xf-pwxr-xx2f, CGA-p93q-r4h6-42x4, CGA-pg59-94r5-22v6, CGA-prf6-gxpm-22x7, CGA-prpw-v77j-m38m, CGA-q5fv-8jmh-m3hm, CGA-qf9g-xrx9-g6g7, CGA-qfcq-mfv3-hf9p, CGA-qh2h-2jqx-qv39, CGA-qvw6-vm5j-rgm6, CGA-qw9x-fg6f-7qc6, CGA-r7vf-35v8-p9cj, CGA-rcwj-3hp7-xfmv, CGA-rpc7-r9wv-g4cp, CGA-v2jr-5pc5-jw2p, CGA-v9v9-g37w-v7mw, CGA-vgc7-54r7-744j, CGA-vm99-qhqq-mh6r, CGA-vqmg-xhcc-h8qf, CGA-w472-rc7m-pxhj, CGA-w4m8-qxqq-9gqx, CGA-w7p9-rf77-42r6, CGA-w85v-pmqv-rh6w, CGA-w8pr-5wh6-p7mc, CGA-wfg7-mccv-hfhx, CGA-wv2x-vw24-3862, CGA-x4gq-8jw2-vwp3, CGA-x645-j2q6-p265, CGA-x864-w4c7-2r8m, CGA-xppr-8xr5-gcgg, CGA-xq9j-r9fh-x8rc
- Record: https://cvemate.com/vulnerability/CVE-2026-59893 · JSON: https://cvemate.com/vulnerability/CVE-2026-59893/json

## 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.
```

## Signals

- CVSS: 7.5 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.337%, percentile 29.018%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 68)

- andialbrecht sqlparse: \< 0.6.0
- chainguard airflow-2 (Chainguard): \< 2.11.2-r16
- chainguard airflow-3 (Chainguard): \< 3.3.1-r3
- chainguard airflow-3-iamguarded-compat (Chainguard): All versions (No fix recorded)
- chainguard airflow-core-2 (Chainguard): \< 2.11.2-r7
- chainguard apache-beam-python-3.14-sdk (Chainguard): \< 2.75.0-r2
- chainguard authentik-2025.12 (Chainguard): \< 2025.12.6-r8
- chainguard authentik-2026.2 (Chainguard): \< 2026.2.6-r16
- chainguard authentik-2026.5 (Chainguard): \< 2026.5.6-r9
- chainguard authentik-fips-2025.12 (Chainguard): \< 2025.12.6-r9
- chainguard authentik-fips-2026.2 (Chainguard): \< 2026.2.6-r16
- chainguard authentik-fips-2026.5 (Chainguard): \< 2026.5.6-r10
- chainguard datahub-ingestion (Chainguard): \< 1.7.0-r2
- chainguard datahub-ingestion-fips (Chainguard): \< 1.7.0-r2
- chainguard dbt-bigquery (Chainguard): \< 1.10.3-r8
- chainguard dbt-core (Chainguard): \< 1.12.3-r0
- chainguard label-studio (Chainguard): \< 1.23.0-r12
- chainguard mlflow (Chainguard): \< 3.15.1-r4 \| \< 3.16.0-r0
- chainguard mlflow-fips (Chainguard): \< 3.15.1-r3
- chainguard mycli (Chainguard): \< 2.16.0-r1

## References

- <https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-prg7-hcfm-mfcr>
- <https://github.com/andialbrecht/sqlparse/commit/d1d80602741f77ec78e5a04ce4719244cf32352e>
- <https://github.com/andialbrecht/sqlparse>
- <https://pypi.org/project/sqlparse>
- <https://github.com/advisories/GHSA-prg7-hcfm-mfcr>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-59893>
- <https://ubuntu.com/security/CVE-2026-59893>
- <https://www.cve.org/CVERecord?id=CVE-2026-59893>
- <https://ubuntu.com/security/notices/USN-8808-1>
- <https://security-tracker.debian.org/tracker/CVE-2026-59893>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59893.json>

---

Data as of 2026-12-05T04:20:51.417Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
