Skip to content
RCE Disclosed report Advanced CVE-2024-4264

litellm passes untrusted data to `eval` function without sanitization

The litellm.get_secret() method passes untrusted data to the eval function without sanitisation when Google KMS is used. An attacker could inject malicious values into environment variables via the /config/update endpoint, potentially leading to remote code execution.

BerriAI/litellm

Originally disclosed on huntr

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.

From the GitHub Advisory Database (GHSA-7ggm-4rjg-594w, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the use of eval on environment variable values without validation or sanitisation in the get_secret method.

Impact

An attacker could achieve remote code execution by injecting malicious values through the /config/update endpoint.

What the attacker needed

Server uses Google KMS; access to /config/update endpoint

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

The eval function runs text as code. If a program feeds user-controlled text into eval, an attacker can make the program run their own code. Here, a settings update endpoint let an attacker put harmful values into environment variables, which were later evaluated.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from BerriAI/litellm

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.