NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · LiteLLM

CVE-2024-5751: litellm vulnerable to remote code execution based on using eval unsafely

criticalCVSS 3.0 9.8GHSA-gppg-gqw8-wh9g

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 litellm

Also 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_secret path 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() from get_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 entries