# CVE-2023-30608: Parser contains an inefficient regular expression in sqlparse

> An inefficient regular expression in the sqlparse library allows attackers to cause a Denial of Service via ReDoS attacks.

- **Severity:** Medium 5.5 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 18 Apr 2023
- **Updated:** 3 Nov 2025
- **Also known as:** DEBIAN-CVE-2023-30608, DLA-3425-1, GHSA-rrm6-wvj7-cwh2, MGASA-2023-0183, OESA-2023-1279, PYSEC-2023-87, ROOT-APP-PYPI-CVE-2023-30608, SUSE-RU-2024:1637-1, SUSE-RU-2024:1637-2, SUSE-RU-2024:1637-3, SUSE-SU-2023:2462-1, SUSE-SU-2023:2619-1, SUSE-SU-2023:2693-1, SUSE-SU-2023:2787-1, UBUNTU-CVE-2023-30608, USN-6064-1, openSUSE-SU-2024:12957-1

## What is CVE-2023-30608?

CVE-2023-30608 is a medium-severity denial of service vulnerability in Debian Debian Linux, published on 18 Apr 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2023-30608?

3 open source packages ship an affected version, including sqlparse. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sqlparse` | PyPI | From 0.1.15 | 0.4.4 |
| `sqlparse` | PyPI | From 0.1.15 | 0.4.4 |
| `sqlparse` | PyPI | From 0.1.15 | 0.4.4 |
| `python-sqlparse` | SUSE:HPE Helion OpenStack 8 | All versions | 0.2.3-3.3.1 |
| `protobuf` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 25.1-150400.9.6.1 |
| `python-apipkg` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 3.0.1-150400.12.6.1 |
| `python-cachetools` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 5.3.1-150400.8.6.1 |
| `python-certifi` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2023.7.22-150400.12.6.2 |
| `python-cffi` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.15.1-150400.8.7.2 |
| `python-charset-normalizer` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 3.1.0-150400.9.7.2 |
| `python-cryptography` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 41.0.3-150400.16.19.1 |
| `python-google-auth` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.27.0-150400.6.7.1 |
| `python-idna` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 3.4-150400.11.6.1 |
| `python-iniconfig` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.0.0-150400.10.6.1 |
| `python-py` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 1.11.0-150400.12.7.2 |
| `python-pyOpenSSL` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 23.2.0-150400.3.10.1 |
| `python-pyasn1` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 0.5.0-150400.12.7.2 |
| `python-pyasn1-modules` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 0.3.0-150400.12.7.1 |
| `python-pycparser` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.21-150400.12.7.2 |
| `python-pytz` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2023.3-150400.6.6.1 |
| `python-requests` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.31.0-150400.6.8.1 |
| `python-rsa` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 4.9-150400.12.7.1 |
| `python-setuptools` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 67.7.2-150400.3.12.1 |
| `python-urllib3` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.0.7-150400.7.14.1 |
| `protobuf` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 25.1-150400.9.6.1 |
| `python-apipkg` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 3.0.1-150400.12.6.1 |
| `python-cachetools` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 5.3.1-150400.8.6.1 |
| `python-certifi` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 2023.7.22-150400.12.6.2 |
| `python-cffi` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.15.1-150400.8.7.2 |
| `python-charset-normalizer` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 3.1.0-150400.9.7.2 |
| `python-cryptography` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 41.0.3-150400.16.19.1 |
| `python-google-auth` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 2.27.0-150400.6.7.1 |
| `python-idna` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 3.4-150400.11.6.1 |
| `python-iniconfig` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 2.0.0-150400.10.6.1 |
| `python-py` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 1.11.0-150400.12.7.2 |
| `python-pyOpenSSL` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 23.2.0-150400.3.10.1 |
| `python-pyasn1` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 0.5.0-150400.12.7.2 |
| `python-pyasn1-modules` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 0.3.0-150400.12.7.1 |
| `python-pycparser` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 2.21-150400.12.7.2 |
| `python-pytz` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 2023.3-150400.6.6.1 |

Products: Debian Debian Linux, Sqlparse Project Sqlparse.

## How do I fix CVE-2023-30608?

Upgrade sqlparse to 0.4.4 or later.

## Is CVE-2023-30608 being exploited?

There is no known exploitation of CVE-2023-30608 in the wild and no public exploit code.

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-30608 and fix it if it is affected.

What it is: CVE-2023-30608 is a medium-severity denial of service vulnerability in Debian Debian Linux, published on 18 Apr 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-30608 in the wild and no public exploit code.

Affected packages and fixed versions:
- sqlparse (PyPI): affected from 0.1.15; fixed in 0.4.4
- sqlparse (PyPI): affected from 0.1.15; fixed in 0.4.4
- sqlparse (PyPI): affected from 0.1.15; fixed in 0.4.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-30608/ (Markdown: https://insights.sbomify.com/CVE-2023-30608/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-30608
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-30608
- OSV: https://osv.dev/vulnerability/CVE-2023-30608

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-30608/
Summaries are generated and may contain mistakes; the official description above is the record.
