Vulnerability · Published Apr 30, 2024 · Assigned by JFROG
CVE-2024-4340Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError.
High 7.5
In plain English
A high-severity security flaw in sqlparse. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 3.2% (higher than 88% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Severity (CVSS 3.1)7.5High
Exploit odds (30 days)3.2%top 11.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known
Official description
Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | sqlparse | 0.4.2-1+deb12u1 | DEBIAN-CVE-2024-4340 |
| Debian:13 | sqlparse | 0.5.0-1 | DEBIAN-CVE-2024-4340 |
| Debian:14 | sqlparse | 0.5.0-1 | DEBIAN-CVE-2024-4340 |
| PyPI | sqlparse | 0.5.0 | GHSA-2m57-hf25-phgg |
| PyPI | sqlparse | 0.5.0 | PYSEC-2026-1940 |
| Ubuntu:22.04:LTS | sqlparse | 0.4.2-1ubuntu0.22.04.2 | USN-6771-1 |
| Ubuntu:22.04:LTS | sqlparse | 0.4.2-1ubuntu0.22.04.2 | UBUNTU-CVE-2024-4340 |
| Ubuntu:24.04:LTS | sqlparse | 0.4.4-1ubuntu0.1 | UBUNTU-CVE-2024-4340 |
| Ubuntu:24.04:LTS | sqlparse | 0.4.4-1ubuntu0.1 | USN-6771-1 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| sqlparse | 0 – before 0.5.0 |
Weakness: CWE-674 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://research.jfrog.com/vulnerabilities/sqlparse-stack-exhaustion-dos-jfsa-2024-001031292/ third-party-advisory
- https://github.com/andialbrecht/sqlparse/commit/b4a39d9850969b4e1d6940d32094ee0b42a2cf03 patch
- https://github.com/advisories/GHSA-2m57-hf25-phgg
- https://lists.debian.org/debian-lts-announce/2024/12/msg00022.html