Vulnerability · Published Apr 18, 2023 · Assigned by GitHub_M

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

Medium 5.5

In plain English

A medium-severity regular-expression denial of service in sqlparse from andialbrecht. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.0% (higher than 62% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.5Medium
Exploit odds (30 days)1.0%top 37.6% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12sqlparse0.4.2-1+deb12u1DEBIAN-CVE-2023-30608
Debian:13sqlparse0.4.4-1DEBIAN-CVE-2023-30608
Debian:14sqlparse0.4.4-1DEBIAN-CVE-2023-30608
PyPIsqlparse0.4.4GHSA-rrm6-wvj7-cwh2
PyPIsqlparse0.4.4PYSEC-2023-87
Ubuntu:22.04:LTSsqlparse0.4.2-1ubuntu0.22.04.1USN-6064-1
Ubuntu:22.04:LTSsqlparse0.4.2-1ubuntu0.22.04.1UBUNTU-CVE-2023-30608

Affected products (as reported)

VendorProductVersions
andialbrecht sqlparse >= 0.1.15, < 0.4.4

Weakness: CWE-1333 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

References