CVE-2026-42271: BerriAI LiteLLM Command Injection Vulnerability
BerriAI LiteLLM contains a command injection vulnerability that could allow any authenticated user, including holders of low-privilege internal-user keys, to run arbitrary commands on the host.
Other sources
LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format. From version 1.74.2 to before version 1.83.7, two endpoints used to preview an MCP server before saving it — POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list — accepted a full server configuration in the request body, including the command, args, and env fields used by the stdio transport. When called with a stdio configuration, the endpoints attempted to connect, which spawned the supplied command as a subprocess on the proxy host with the privileges of the proxy process. The endpoints were gated only by a valid proxy API key, with no role check. Any authenticated user — including holders of low-privilege internal-user keys — could therefore run arbitrary commands on the host. This issue has been patched in version 1.83.7.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
BerriAI LiteLLMto a version that resolves this vulnerability.Fixed in 1.83.7
Event History
Frequently Asked Questions
What is the severity of CVE-2026-42271?
CVE-2026-42271 has been classified with a high severity level due to the potential for authenticated command execution.
How do I fix CVE-2026-42271?
To mitigate CVE-2026-42271, upgrade to LiteLLM version 1.83.7 or later.
What are the affected versions of LiteLLM for CVE-2026-42271?
LiteLLM versions from 1.74.2 to before 1.83.7 are affected by CVE-2026-42271.
What type of vulnerability is CVE-2026-42271?
CVE-2026-42271 is classified as an authenticated command execution vulnerability.
Which endpoints are involved in CVE-2026-42271?
CVE-2026-42271 involves the POST /mcp-rest/test/connection and related preview endpoints.