CVE-2024-6825 Remote Code Execution in BerriAI/litellm
Attackers can execute arbitrary code by injecting malicious callbacks into the post_call_rules configuration in LiteLLM.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2024-6825?
CVE-2024-6825 is a high-severity code injection vulnerability in berriai/litellm, published on 20 Mar 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
BerriAI/litellm version 1.40.12 contains a vulnerability that allows remote code execution. The issue exists in the handling of the 'post_call_rules' configuration, where a callback function can be added. The provided value is split at the final '.' mark, with the last part considered the function name and the remaining part appended with the '.py' extension and imported. This allows an attacker to set a system method, such as 'os.system', as a callback, enabling the execution of arbitrary commands when a chat response is processed.
Weakness: CWE-94
Which versions are affected by CVE-2024-6825?
3 open source packages ship an affected version, including litellm. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
litellm PyPI | From 1.40.3.dev2 to 1.40.12 | None |
litellm PyPI | From 1.40.3.dev2 to 1.40.12 | None |
litellm PyPI | From 1.40.3.dev2 to 1.40.12 | None |
Products include Litellm Litellm.
How do I fix CVE-2024-6825?
No fix has been published for CVE-2024-6825 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-6825 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-6825 exists.
Other vulnerabilities in berriai/litellm
Sources
Also known as GHSA-53gh-p8jc-7rg8, PYSEC-2026-1541.