Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. sqlparse
  4. ›
  5. CVE-2024-4340

CVE-2024-4340: sqlparse parsing heavily nested list leads to Denial of Service

April 15, 2024 (updated May 1, 2024)

Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError.

References

  • github.com/advisories/GHSA-2m57-hf25-phgg
  • github.com/andialbrecht/sqlparse
  • github.com/andialbrecht/sqlparse/commit/b4a39d9850969b4e1d6940d32094ee0b42a2cf03
  • github.com/andialbrecht/sqlparse/security/advisories/GHSA-2m57-hf25-phgg
  • nvd.nist.gov/vuln/detail/CVE-2024-4340
  • research.jfrog.com/vulnerabilities/sqlparse-stack-exhaustion-dos-jfsa-2024-001031292

Code Behaviors & Features

Detect and mitigate CVE-2024-4340 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.5.0

Fixed versions

  • 0.5.0

Solution

Upgrade to version 0.5.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-674: Uncontrolled Recursion

Source file

pypi/sqlparse/CVE-2024-4340.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:53 +0000.