# CVE-2023-30608: sqlparse contains a regular expression that is vulnerable to Regular Expression Denial of Service

Source: https://junglewise.ai/threats/cve-2023-30608-sqlparse-contains-a-regular-expression-that-is-vulnerable-to  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2023-04-18  
License: CC BY 4.0 with a link back

CVE-2023-30608 · Severity: low · CVSS 3.1 · Published 2023-04-18

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.

Technologies: [sqlparse (PyPI)](https://junglewise.ai/threats/technologies/sqlparse). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2023-30608 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2023-30608 being exploited in the wild.

**How severe is CVE-2023-30608?** Low severity, with a CVSS score of 3.1, published 18 April 2023.

**Which products and versions are affected?** sqlparse (PyPI) ECOSYSTEM:introduced=0.1.15,fixed=0.4.4, GIT:introduced=0,fixed=c457abd5f097dd13fb21543381e7cfafe7d31cfb,fixed=e75e35869473832a1eb67772b1adfee2db11b85a|ECOSYSTEM:introduced=0.1.15,fixed=0.4.4.

**Is there a fix for CVE-2023-30608?** Yes. sqlparse (PyPI): upgrade to 0.4.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2023-30608?** Check whether you run sqlparse (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- sqlparse (PyPI): upgrade to 0.4.4 or later

  ```sh
  pip install "sqlparse>=0.4.4"
  ```


## Affected products

- sqlparse (PyPI) ECOSYSTEM:introduced=0.1.15,fixed=0.4.4, GIT:introduced=0,fixed=c457abd5f097dd13fb21543381e7cfafe7d31cfb,fixed=e75e35869473832a1eb67772b1adfee2db11b85a|ECOSYSTEM:introduced=0.1.15,fixed=0.4.4

## Identifiers

- CVE-2023-30608
- GHSA-rrm6-wvj7-cwh2
- PYSEC-2023-87

## Related threats

- [sqlparse quadratic CPU consumption in reindent filter](https://junglewise.ai/threats/cve-2026-84305-sqlparse-quadratic-cpu-consumption-in-reindent-filter)
- [sqlparse quadratic DoS in group_comments](https://junglewise.ai/threats/cve-2026-71491-sqlparse-quadratic-dos-in-group-comments)
- [sqlparse code injection in Python and PHP output modes](https://junglewise.ai/threats/cve-2026-59894-sqlparse-code-injection-in-python-and-php-output-modes)
- [sqlparse inefficient regex handling in dollar-quoted literals](https://junglewise.ai/threats/cve-2026-59893-sqlparse-inefficient-regex-handling-in-dollar-quoted-literals)
- [sqlparse TokenList CPU denial of service](https://junglewise.ai/threats/cve-2026-54284-sqlparse-tokenlist-cpu-denial-of-service)
