CVE-2024-5751: litellm vulnerable to remote code execution based on using eval unsafely
Affects litellmSource GCVE Database
Not known to be exploited · CVSS 9.8 Critical : upgrade to 1.40.16 as a priority.
Data as of 16 Nov 2026, 17:33 UTC
- Patch
- Available – fixed in 1.40.16
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 27 Jun 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by 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 15 Nov 2026.
What to do
Upgrade litellm to 1.40.16.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIlitellm | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade litellm to version 1.40.16 or later, where this vulnerability is fixed. Applying this official patch fully mitigates the risk. No additional mitigations are specified or required beyond applying the update.
Description
A critical remote code execution vulnerability (CVE-2024-5751) affects litellm versions prior to 1.40.16. The flaw exists in the add_deployment function, which unsafely uses eval by decoding and decrypting environment variables and assigning them to os.environ. An attacker can exploit this by sending a crafted payload to the /config/update endpoint, leading to arbitrary code execution when the get_secret function is called. This vulnerability requires the server to be configured with Google KMS and a database for model storage. The issue is fixed in version 1.40.16.
References
- nvd.nist.gov/vuln/detail/CVE-2024-5751 (opens in a new tab)
- github.com/BerriAI/litellm/pull/4228 (opens in a new tab)
- github.com/BerriAI/litellm/commit/fcea4c22ad96b24436f196ae709f71932e84b0b8 (opens in a new tab)
- github.com/berriai/litellm (opens in a new tab)
- github.com/pypa/advisory-database/tree/main/vulns/litellm/PYSEC-2026-389.yaml (opens in a new tab)
- huntr.com/bounties/ae623c2f-b64b-4245-9ed4-f13a0a5824ce (opens in a new tab)
- pypi.org/project/litellm (opens in a new tab)