---
id: "CVE-2024-5751"
page: "https://infrastack.ai/live/CVE-2024-5751"
kind: "vulnerability"
aliases: ["CVE-2024-5751", "GHSA-gppg-gqw8-wh9g"]
title: "litellm vulnerable to remote code execution based on using eval unsafely"
severity: "critical"
cvss: 9.8
epss: 0.00882
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "litellm", "fixed": ["1.40.16"], "affected": "< 1.40.16", "ecosystem": "pypi"}, {"name": "litellm", "fixed": [], "affected": "= 1.35.8", "ecosystem": "vendor"}, {"via": "cpe", "name": "litellm", "fixed": [], "affected": "= 1.35.8", "ecosystem": "pypi"}]
ecosystems: ["pypi", "vendor"]
tags: ["ai-gateway", "ai-tooling", "cwe-94", "litellm", "python", "self-hosted"]
not_affected_if: ["library-only-use", "no-config-update-endpoint", "no-google-kms"]
published_at: "2024-06-27T19:15:16+00:00"
first_seen_at: "2026-11-16T15:17:21+00:00"
updated_at: "2026-11-16T15:37:59+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-gppg-gqw8-wh9g", "first_seen_at": "2026-11-16T15:17:21+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-5751", "first_seen_at": "2026-11-16T15:37:59+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.00882, "url": "https://api.first.org/data/v1/epss?cve=CVE-2024-5751"}]
---

# litellm vulnerable to remote code execution based on using eval unsafely

Link for people: https://infrastack.ai/live/CVE-2024-5751 (this .md is for agents)

LiteLLM, a Python gateway for calling language models, evaluates attacker-supplied data in its config update path, so a crafted request to the /config/update endpoint can execute code on the server. The sources say an attacker gets remote code execution, which means taking over the server process.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:litellm affected < 1.40.16 fixed 1.40.16
- vendor:litellm affected = 1.35.8 fixed no fixed version listed
- pypi:litellm affected = 1.35.8 fixed no fixed version listed

## How to check

- Check the installed version with `pip show litellm`; versions below `1.40.16` are affected.
- Look for a deployment that exposes the `/config/update` endpoint and uses Google KMS with a database to store models, since the sources say that setup is required.

## Fix

- Upgrade `litellm` to `1.40.16` or later.

## Timeline

- 2026-11-16T15:17:21+00:00 ghsa https://github.com/advisories/GHSA-gppg-gqw8-wh9g
- 2026-11-16T15:37:59+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-5751

## Documents

- [advisory] Third-party advisory: huntr.com https://huntr.com/bounties/ae623c2f-b64b-4245-9ed4-f13a0a5824ce
- [fix] Patch: github.com https://github.com/BerriAI/litellm/pull/4228
- [fix] Patch: github.com https://github.com/BerriAI/litellm/commit/fcea4c22ad96b24436f196ae709f71932e84b0b8

## From the sources

BerriAI/litellm version v1.35.8 contains a vulnerability where an attacker can achieve remote code execution. The vulnerability exists in the `add_deployment` function, which decodes and decrypts environment variables from base64 and assigns them to `os.environ`. An attacker can exploit this by sending a malicious payload to the `/config/update` endpoint, which is then processed and executed by the server when the `get_secret` function is triggered. This requires the server to use Google KMS and a database to store a model.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
