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

EcosystemPackageFixed inAdvisory
Debian:12sqlparse0.4.2-1+deb12u1DEBIAN-CVE-2024-4340
Debian:13sqlparse0.5.0-1DEBIAN-CVE-2024-4340
Debian:14sqlparse0.5.0-1DEBIAN-CVE-2024-4340
PyPIsqlparse0.5.0GHSA-2m57-hf25-phgg
PyPIsqlparse0.5.0PYSEC-2026-1940
Ubuntu:22.04:LTSsqlparse0.4.2-1ubuntu0.22.04.2USN-6771-1
Ubuntu:22.04:LTSsqlparse0.4.2-1ubuntu0.22.04.2UBUNTU-CVE-2024-4340
Ubuntu:24.04:LTSsqlparse0.4.4-1ubuntu0.1UBUNTU-CVE-2024-4340
Ubuntu:24.04:LTSsqlparse0.4.4-1ubuntu0.1USN-6771-1

Affected products (as reported)

VendorProductVersions
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