CVE-2026-42271 BerriAI LiteLLM Command Injection

Exploited in the wild High 8.7 Published Updated

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.

Weakness: CWE-78, CWE-77

Which versions are affected by CVE-2026-42271?

3 open source packages ship an affected version, including litellm. It affects 2 products.

PackageAffectedFixed in
litellm PyPIFrom 1.74.21.83.7
litellm PyPIFrom 1.74.21.83.7
litellm PyPIFrom 1.74.21.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.

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.

Is CVE-2026-42271 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free