CVE-2024-5751: litellm vulnerable to remote code execution based on using eval unsafely
litellm before 1.40.16 runs Python `eval()` inside `get_secret` on a value an attacker can set through the `/config/update` endpoint. That gives unauthenticated remote code execution on the proxy, but only when the server uses Google KMS and a database to store a model. Upgrade to litellm 1.40.16.
Published Jun 27, 2024 · Updated Nov 16, 2026 · Analysis Nov 1, 2026
What an attacker can do
The add_deployment function decodes and decrypts environment variables from base64 and assigns them to os.environ. An attacker sends a crafted payload to /config/update. Later, when get_secret is called, it handles a Google KMS secret. If the stored value was not bytes, the code called eval() to turn a bytes-literal string into bytes. A string such as an expression therefore ran as Python on the server.
The CVSS 3.0 vector says no privileges and no user interaction, and the advisory sets two preconditions: Google KMS must be configured and a database must hold a model. When those hold, anyone who can reach the proxy can run commands as the litellm process. The proxy holds the API keys of every model provider it fronts, so key theft is the obvious result, followed by use of the host as a foothold.
Who is affected
Affected: litellm < 1.40.16. The advisory describes version 1.35.8, and the data lists everything below 1.40.16. Only deployments that run the proxy with Google KMS and a database-stored model can be exploited this way. Check the version:
pip show litellmAlso confirm whether your config uses Google KMS for secrets and whether /config/update is reachable by untrusted clients.
litellm
- Ecosystem
- PyPI
- Affected
- < 1.40.16
- Fixed in
- 1.40.16
- Check
pip show litellm
How to fix it
Upgrade to litellm 1.40.16.
pip install --upgrade "litellm>=1.40.16"The fix removes the eval() call from get_secret in litellm/utils.py. A secret that is not valid base64 now raises ValueError with the text Google KMS requires the encrypted secret to be encoded in base64. The sources list no workaround. Until you upgrade, keep the proxy's config endpoints off untrusted networks.
How to tell if you were hit
Look in proxy access logs for POST requests to /config/update from unexpected clients. Review the stored model and environment values in the database for entries that are not base64 text. After the upgrade, a ValueError containing Google KMS requires the encrypted secret to be encoded in base64 in the logs means a malformed or hostile secret was refused. Check the host for unexpected child processes and outbound connections from the litellm process.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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.
Questions
- Is every litellm proxy exposed to CVE-2024-5751?
No. The advisory says the server must use Google KMS and a database to store a model. Without both, the vulnerable
get_secretpath is not reached as described.- Does the attacker need to log in?
The CVSS vector shows no privileges required. The attacker sends the payload to
/config/update, which the advisory presents as reachable remotely.- Which release fixes it?
litellm 1.40.16 contains the fix that removes
eval()fromget_secret.
References
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
