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

Medium 5.5 Published Updated

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

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

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

Which versions are affected by CVE-2023-30608?

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

PackageAffectedFixed in
sqlparse PyPIFrom 0.1.150.4.4
sqlparse PyPIFrom 0.1.150.4.4
sqlparse PyPIFrom 0.1.150.4.4
Linux distribution packages (37)
python-sqlparse SUSE:HPE Helion OpenStack 8All versions0.2.3-3.3.1
protobuf SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions25.1-150400.9.6.1
python-apipkg SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions3.0.1-150400.12.6.1
python-cachetools SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions5.3.1-150400.8.6.1
python-certifi SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2023.7.22-150400.12.6.2
python-cffi SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions1.15.1-150400.8.7.2
python-charset-normalizer SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions3.1.0-150400.9.7.2
python-cryptography SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions41.0.3-150400.16.19.1
python-google-auth SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2.27.0-150400.6.7.1
python-idna SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions3.4-150400.11.6.1
python-iniconfig SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2.0.0-150400.10.6.1
python-py SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions1.11.0-150400.12.7.2
python-pyOpenSSL SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions23.2.0-150400.3.10.1
python-pyasn1 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions0.5.0-150400.12.7.2
python-pyasn1-modules SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions0.3.0-150400.12.7.1
python-pycparser SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2.21-150400.12.7.2
python-pytz SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2023.3-150400.6.6.1
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2.31.0-150400.6.8.1
python-rsa SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions4.9-150400.12.7.1
python-setuptools SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions67.7.2-150400.3.12.1
python-urllib3 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2.0.7-150400.7.14.1
protobuf SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions25.1-150400.9.6.1
python-apipkg SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions3.0.1-150400.12.6.1
python-cachetools SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions5.3.1-150400.8.6.1
python-certifi SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions2023.7.22-150400.12.6.2
python-cffi SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions1.15.1-150400.8.7.2
python-charset-normalizer SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions3.1.0-150400.9.7.2
python-cryptography SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions41.0.3-150400.16.19.1
python-google-auth SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions2.27.0-150400.6.7.1
python-idna SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions3.4-150400.11.6.1
python-iniconfig SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions2.0.0-150400.10.6.1
python-py SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions1.11.0-150400.12.7.2
python-pyOpenSSL SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions23.2.0-150400.3.10.1
python-pyasn1 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions0.5.0-150400.12.7.2
python-pyasn1-modules SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions0.3.0-150400.12.7.1
python-pycparser SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions2.21-150400.12.7.2
python-pytz SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions2023.3-150400.6.6.1

Products include Debian Debian Linux, Sqlparse Project Sqlparse.

How do I fix CVE-2023-30608?

Upgrade sqlparse to 0.4.4 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2023-30608 being exploited?

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

All Debian Debian Linux vulnerabilities

Sources

Also known as DEBIAN-CVE-2023-30608, DLA-3425-1, GHSA-rrm6-wvj7-cwh2, MGASA-2023-0183, OESA-2023-1279, PYSEC-2023-87 and 11 more.

Is CVE-2023-30608 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free