berriai/litellm · Security
LiteLLM Vulnerable to Remote Code Execution (RCE)
- GHSA ID
- GHSA-53gh-p8jc-7rg8
- CVE ID
- CVE-2024-6825
- Severity
- high
- Published
- Updated
- CVSS
- 8.8 · CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CVSS v3
- 8.8 · CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
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.
CWEs
- CWE-77 · Improper Neutralization of Special Elements used in a Command ('Command Injection')
- CWE-94 · Improper Control of Generation of Code ('Code Injection')
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-6825 ↗
- https://huntr.com/bounties/1d98bebb-6cf4-46c9-87c3-d3b1972973b5 ↗
- https://github.com/BerriAI/litellm/blob/056913fd7049923a106130b02d7c29e7f312beec/litellm/utils.py#L2818 ↗
- https://github.com/berriai/litellm/commit/441c7275ed2715f47650a7c2e525055c804073a9 ↗
- https://github.com/advisories/GHSA-53gh-p8jc-7rg8 ↗