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.
The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Litellm | Litellm | * | 1.65.4 (excluding) |
Litellm | Litellm | 1.65.4-dev2 (including) | 1.65.4-dev2 (including) |
Command injection vulnerabilities typically occur when:
Many protocols and products have their own custom command language. While OS or shell command strings are frequently discovered and targeted, developers may not realize that these other command languages might also be vulnerable to attacks. Command injection is a common problem with wrapper programs.