CVE-2024-5751 Remote Code Execution in BerriAI/litellm
Attackers can achieve remote code execution in LiteLLM by sending malicious payloads to the config update endpoint when Google KMS and database storage are enabled.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-5751?
CVE-2024-5751 is a critical code injection vulnerability in berriai/litellm, published on 27 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-94
Which versions are affected by CVE-2024-5751?
3 open source packages ship an affected version, including litellm. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
litellm PyPI | All versions | 1.40.16 |
litellm PyPI | All versions | 1.40.16 |
litellm PyPI | All versions | 1.40.16 |
Products include Litellm Litellm.
How do I fix CVE-2024-5751?
Upgrade litellm to 1.40.16 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2024-5751 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5751 exists.
Other vulnerabilities in berriai/litellm
Sources
Also known as GHSA-gppg-gqw8-wh9g, PYSEC-2026-389.