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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | sqlparse | 0.4.2-1+deb12u1 | DEBIAN-CVE-2023-30608 |
| Debian:13 | sqlparse | 0.4.4-1 | DEBIAN-CVE-2023-30608 |
| Debian:14 | sqlparse | 0.4.4-1 | DEBIAN-CVE-2023-30608 |
| PyPI | sqlparse | 0.4.4 | GHSA-rrm6-wvj7-cwh2 |
| PyPI | sqlparse | 0.4.4 | PYSEC-2023-87 |
| Ubuntu:22.04:LTS | sqlparse | 0.4.2-1ubuntu0.22.04.1 | USN-6064-1 |
| Ubuntu:22.04:LTS | sqlparse | 0.4.2-1ubuntu0.22.04.1 | UBUNTU-CVE-2023-30608 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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
- https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-rrm6-wvj7-cwh2 x_refsource_CONFIRM
- https://github.com/andialbrecht/sqlparse/commit/c457abd5f097dd13fb21543381e7cfafe7d31cfb x_refsource_MISC
- https://github.com/andialbrecht/sqlparse/commit/e75e35869473832a1eb67772b1adfee2db11b85a x_refsource_MISC
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS x_refsource_MISC
- https://lists.debian.org/debian-lts-announce/2023/05/msg00017.html
- https://lists.debian.org/debian-lts-announce/2024/12/msg00022.html