Remote Code Execution in BerriAI/litellm (CVE-2024-6825)
A remote code execution vulnerability (CVE-2024-6825) was reported in BerriAI's litellm library, allowing arbitrary code execution through improper module import validation. The vendor patched the vulnerability by implementing security checks to block imports of dangerous Python modules.
What happened
A remote code execution vulnerability (CVE-2024-6825) was identified in BerriAI's litellm, an open-source library for interfacing with multiple large language models. The vulnerability existed in the module loading functionality of the proxy component, which failed to properly restrict imports of dangerous Python modules.
Index analysis
The vulnerability allowed attackers to execute arbitrary code by importing and executing dangerous modules including os, sys, subprocess, shutil, socket, multiprocessing, threading, ctypes, pickle, marshal, and builtins through the get_instance_fn function.
Governance controls
BerriAI implemented a security_checks function in the proxy module that validates module names before import and raises an ImportError when attempting to import from a list of dangerous modules. The fix was applied in commit 441c7275ed2715f47650a7c2e525055c804073a9, which added both the security check and corresponding test cases.
Classification
Sources and evidence
This record was researched and written by the Index, based on the following original reporting.