CVE-2024-4264 Remote Code Execution in berriai/litellm

Critical 9.8 Published Updated

Attackers can execute arbitrary code by injecting malicious values into environment variables via the config update endpoint when Google KMS is used.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2024-4264?

CVE-2024-4264 is a critical code injection vulnerability in berriai/litellm, published on 18 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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`.

Weakness: CWE-94

Which versions are affected by CVE-2024-4264?

3 open source packages ship an affected version, including litellm.

PackageAffectedFixed in
litellm PyPIAll versions to 1.28.11None
litellm PyPIAll versions to 1.28.11None
litellm PyPIAll versions to 1.28.11None

How do I fix CVE-2024-4264?

No fix has been published for CVE-2024-4264 yet. Limit exposure of the affected software until one is available.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2024-4264 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-4264 exists.

Sources

Also known as GHSA-7ggm-4rjg-594w, PYSEC-2026-1542.

Is CVE-2024-4264 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free