Skip to main content
VulnerabilityPublished Updated

CVE-2024-4340: sqlparse · Uncontrolled Recursion

Affects sqlparseSource CVE Database V5

0

Not known to be exploited · CVSS 7.5 High.

Data as of 26 Oct 2026, 11:42 UTC

CVSS 3.1 base score
7.5High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
3.2% chance of exploitation in 30 days – higher than 88% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 30 Apr 2024

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.

What to do

Affected software

ProductAffectedFixed in
PyPIsqlparsepkg:pypi/sqlparseOther threatsAffected
  • =0
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Until an official patch is released, European organizations should implement strict input validation to detect and reject excessively nested or malformed SQL inputs before they reach sqlparse.parse(). Applying recursion depth limits at the application level can prevent uncontrolled recursion. Monitoring application logs for RecursionError exceptions can help detect attempted exploitation. Employing Web Application Firewalls (WAFs) to filter suspicious payloads targeting SQL parsing endpoints is recommended. Developers should review and update dependencies regularly and subscribe to sqlparse security advisories for timely patch releases. In environments where sqlparse is critical, consider isolating parsing operations in sandboxed processes to contain potential crashes. Additionally, organizations can contribute to or monitor open-source sqlparse repositories for community patches or mitigations. Finally, conducting penetration testing focused on input fuzzing can help identify vulnerable endpoints.

Description

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

References

Community reviews

Loading reviews…