litellm vulnerable to remote code execution based on using eval unsafely
The add_deployment function decodes and decrypts environment variables from base64 and assigns them to os.environ, and an attacker can send a malicious payload to the /config/update endpoint that is later executed when get_secret is triggered. This allows remote code execution if the server uses Google KMS and a database to store a model.
BerriAI/litellm
Originally disclosed on huntr
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.
From the GitHub Advisory Database (GHSA-gppg-gqw8-wh9g, CC BY 4.0).
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 add_deployment function unsafely uses eval on decoded and decrypted environment variables, allowing attacker-controlled input to be executed.
Impact
An attacker could achieve remote code execution, but only if the server uses Google KMS and a database to store a model.
What the attacker needed
Server uses Google KMS; server uses a database to store a model
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.
This is a remote code execution bug, meaning an attacker can make the server run their own commands. The server takes input from a web endpoint and later runs it as if it were trusted code, so anyone who can reach that endpoint could take over the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.