CVE-2024-4264: litellm passes untrusted data to `eval` function without sanitization
LiteLLM 1.28.11 and earlier pass untrusted data to eval in litellm.get_secret() when the proxy uses Google KMS. An administrator-level caller can set environment values through /config/update and run code on the proxy host. The advisory lists no patched version.
Published May 18, 2024 · Updated May 20, 2024 · Analysis Nov 2, 2026
What an attacker can do
When the server is set up with Google KMS, litellm.get_secret() evaluates the value it reads using Python eval, with no sanitization. The proxy's /config/update endpoint lets a caller change settings stored in proxy_server_config.yaml, including environment variables. An attacker can put a crafted value in an environment variable. The next secret lookup evaluates it as Python code.
The CVSS vector (7.2) requires high privileges. The caller needs rights to update the proxy configuration, so this is not an anonymous attack. It matters most where many people hold admin keys, where an admin key leaks, or where /config/update is reachable from untrusted networks. The result is code execution as the proxy user, which holds the upstream provider API keys for every model the gateway serves. An attacker could steal them, read prompts and responses, or move on from that host.
Who is affected
The pip package litellm at version 1.28.11 and earlier. The code path applies only when the proxy server uses Google KMS. Check the installed version:
pip show litellmThen check whether your proxy config enables Google KMS and who holds a key that can call /config/update.
litellm
- Ecosystem
- PyPI
- Affected
- <= 1.28.11
- Fixed in
- No patched version yet
- Check
pip show litellm
How to fix it
The GitHub advisory lists no patched version for the range of 1.28.11 and earlier, and gives no workaround. Move to a current litellm release and confirm that get_secret() no longer calls eval on the secret value in that release. The advisory does not confirm which release changed it.
Until you have checked, restrict who can call /config/update, keep admin keys out of shared use, and do not expose the proxy admin routes to the internet. Do not enable Google KMS on an affected version unless you must.
How to tell if you were hit
Review proxy access logs for calls to /config/update, especially from unexpected callers, and for environment settings with Python-looking content (parentheses, __import__, quotes, semicolons). Compare proxy_server_config.yaml with your version-controlled copy. On the host, check for child processes spawned by the proxy and for outbound connections it does not normally make. Rotate provider keys if you find a suspicious update.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
A remote code execution (RCE) vulnerability exists in the berriai/litellm project due to improper control of the generation of code when using the eval function unsafely in the litellm.get_secret() method. Specifically, when the server utilizes Google KMS, untrusted data is passed to the eval function without any sanitization. Attackers can exploit this vulnerability by injecting malicious values into environment variables through the /config/update endpoint, which allows for the update of settings in proxy_server_config.yaml.
Questions
- Does CVE-2024-4264 affect every LiteLLM proxy?
No. The unsafe eval sits in get_secret() and applies when the server uses Google KMS. Versions 1.28.11 and earlier are in range.
- Can an unauthenticated user exploit it?
Not by the advisory. The CVSS vector requires high privileges, because the attacker must be able to call /config/update to set the malicious environment values.
- Is it exploited in the wild?
The advisory does not say so and the entry is not in CISA's KEV catalog. Its EPSS score is below 1 percent.
References
Read for this analysis:
- https://nvd.nist.gov/vuln/detail/CVE-2024-4264
- https://huntr.com/bounties/a3221b0c-6e25-4295-ab0f-042997e8fc61
- https://github.com/BerriAI/litellm/blob/main/litellm/proxy/proxy_server.py#L2104-L2108
- https://github.com/BerriAI/litellm/blob/main/litellm/proxy/proxy_server.py#L2118
- https://github.com/BerriAI/litellm/blob/main/litellm/proxy/proxy_server.py#L2509-L2517
- https://github.com/BerriAI/litellm/blob/main/litellm/proxy/proxy_server.py#L2562-L2577
- https://github.com/BerriAI/litellm/blob/main/litellm/utils.py#L9867-L9885
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More LiteLLM vulnerabilities
All LiteLLM entriesCVE-2026-114612
LiteLLM: Privilege Escalation to Proxy Admin via Cross-Domain Reuse of the Salt Key
high9.9Oct 27, 2026GHSA-g5ff-637f-6q2m
LiteLLM: internal_user_viewer arbitrary local file read via `vertex_ai_credentials`
high8.1Oct 27, 2026GHSA-hhww-mrg2-969h
LiteLLM vulnerable to reflected XSS in /sso/debug/callback
medium6.8Oct 27, 2026CVE-2026-84377
LiteLLM: Authenticated SSRF and provider-credential exfiltration via unvalidated request-body routing parameters
medium6.5Sep 30, 2026CVE-2026-59823
LiteLLM Proxy has server-side request forgery via the `user_config` request parameter
medium5.3Sep 17, 2026CVE-2026-37004
LiteLLM vulnerable to server-side template injection in the /prompts/test endpoint
critical9.8Aug 27, 2026
