# CVE-2024-4340: Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError.

- Severity: High 7.5 (CVSS:3.1, scored by JFROG) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 3.24%, higher than 88% of CVEs (2026-12-01)
- Published: 2024-04-15T20:21:25.000Z
- Modified: 2026-09-10T03:50:10.904Z
- Also known as: GHSA-2m57-hf25-phgg, PYSEC-2026-1940
- Weaknesses: CWE-674
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: JFROG

## Description

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

(As written by CVE List.)

## Affected

- sqlparse: before 0.5.0
- sqlparse_project sqlparse: 0
- sqlparse (PyPI): before 0.5.0

## Every score

- JFROG: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 7.5 High `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, web)
- <https://github.com/advisories/GHSA-2m57-hf25-phgg> (advisory)
- <https://lists.debian.org/debian-lts-announce/2024/12/msg00022.html>
- <https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-2m57-hf25-phgg> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-4340> (advisory)
- <https://github.com/andialbrecht/sqlparse> (package)
- <https://research.jfrog.com/vulnerabilities/sqlparse-stack-exhaustion-dos-jfsa-2024-001031292> (web)
- <https://pypi.org/project/sqlparse> (package)

## Sources

- CVE List: [CVE-2024-4340](https://www.cve.org/CVERecord?id=CVE-2024-4340), CVE Terms of Use, modified 2025-11-03
- GitHub Advisory Database: [GHSA-2m57-hf25-phgg](https://github.com/advisories/GHSA-2m57-hf25-phgg), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-4340](https://nvd.nist.gov/vuln/detail/CVE-2024-4340), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1940](https://osv.dev/vulnerability/PYSEC-2026-1940), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2024-4340 · Whole record: https://cve.day/CVE-2024-4340.json · Rebuilt by cve.day 2026-11-25T22:58:39.709Z
