CVE-2023-30608
Parser contains an inefficient regular expression in sqlparse
Reported by github_m · Published April 18, 2023
sqlparse is fixed in c457abd5f097dd13fb21543381e7cfafe7d31cfb and 0.4.4 (PyPI)
sqlparse is a non-validating SQL parser module for Python. In affected versions the SQL parser contains a regular expression that is vulnerable to ReDoS (Regular Expression Denial of Service). This issue was introduced by commit `e75e358`. The vulnerability may lead to Denial of Service (DoS). This issues has been fixed in sqlparse 0.4.4 by commit `c457abd5f`. Users are advised to upgrade. There are no known workarounds for this issue.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| sqlparse | PyPI | c457abd5f097dd13fb21543381e7cfafe7d31cfb, 0.4.4 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| andialbrecht | sqlparse | >= 0.1.15, < 0.4.4 |
| andialbrecht | sqlparse | 0.1.15 |
| PyPI | sqlparse | 0.1.15 |
Timeline
- Apr 18, 2023 CVE Published
- Apr 19, 2023 EPSS Score (30 in total, the first dated here)
- Nov 4, 2025 CVE Updated
- Mar 10, 2026 Security Advisory (2 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2023-30608
vulnetix vdb fixes CVE-2023-30608
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-30608/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-rrm6-wvj7-cwh2 x_refsource_CONFIRM
- https://github.com/andialbrecht/sqlparse/commit/c457abd5f097dd13fb21543381e7cfafe7d31cfb x_refsource_MISC
- https://github.com/andialbrecht/sqlparse/commit/e75e35869473832a1eb67772b1adfee2db11b85a x_refsource_MISC
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS x_refsource_MISC
- https://lists.debian.org/debian-lts-announce/2024/12/msg00022.html url
- https://nvd.nist.gov/vuln/detail/CVE-2023-30608 advisory
- https://github.com/advisories/GHSA-rrm6-wvj7-cwh2 advisory
- https://github.com/andialbrecht/sqlparse url
- https://github.com/pypa/advisory-database/tree/main/vulns/sqlparse/PYSEC-2023-87.yaml advisory