CVE-2023-30608
JSON

5.5medium

Parser contains an inefficient regular expression in sqlparse

Severity
5.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.98% (higher than 63% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-rrm6-wvj7-cwh2PYSEC-2023-87

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.

Affected

Product or packageVersionsReported by
andialbrecht sqlparse>= 0.1.15, < 0.4.4CVE List
sqlparse (PyPI)from 0.1.15 before 0.4.4, before c457abd5f097dd13fb21543381e7cfafe7d31cfb, before e75e35869473832a1eb67772b1adfee2db11b85aGitHub Advisory Database, PyPA Advisory Database
sqlparse_project sqlparsefrom 0.1.15 before 0.4.4NVD
debian debian_linux10.0NVD

All scores

GitHub_M5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
GitHub5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-1333

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

The SQL parser contains a regular expression that is vulnerable to ReDoS (Regular Expression Denial of Service). The vulnerability may lead to Denial of Service (DoS).

Patches

This issues has been fixed in sqlparse 0.4.4.

Workarounds

None.

References

This issue was discovered and reported by GHSL team member @erik-krogh (Erik Krogh Kristensen).

  • Commit that introduced the vulnerability: e75e35869473832a1eb67772b1adfee2db11b85a

References

Sources

SourceRecordLicence
CVE ListCVE-2023-30608 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-rrm6-wvj7-cwh2 changed 2025-11-04CC-BY-4.0
NVDCVE-2023-30608 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2023-87 changed 2023-11-08CC-BY-4.0