CVE-2026-42271 BerriAI LiteLLM Command Injection
Authenticated users can execute arbitrary commands on the host via MCP stdio test endpoints due to missing role checks.
- Exploited in the wild
- Since 8 Jun 2026
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-42271?
CVE-2026-42271 is a high-severity command injection vulnerability in BerriAI litellm, published on 8 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
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.
Which versions are affected by CVE-2026-42271?
3 open source packages ship an affected version, including litellm. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
litellm PyPI | From 1.74.2 | 1.83.7 |
litellm PyPI | From 1.74.2 | 1.83.7 |
litellm PyPI | From 1.74.2 | 1.83.7 |
Products include Litellm Litellm, Redhat Openshift Ai.
How do I fix CVE-2026-42271?
Upgrade litellm to 1.83.7 or later. US federal agencies must fix it by 22 Jun 2026.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2026-42271 being exploited?
Yes. Attackers have exploited CVE-2026-42271 in the wild since at least 8 Jun 2026.
Public exploit code: 1 Metasploit module, 1 Nuclei template and 2 proofs of concept on GitHub.
Other vulnerabilities in BerriAI litellm
Sources
Also known as ECHO-c4c7-aed2-2231, GHSA-v4p8-mg3p-g94g, MINI-2r2w-xq7g-q5j6, MINI-45w8-qv5q-qqcp, MINI-4r4g-687v-g9j9, MINI-7qv8-pqwr-2c4r and 3 more.