Skip to main content
Mallory
HighCISA KEVExploited in the wildPublic exploit

Command Injection in BerriAI LiteLLM MCP preview endpoints

IdentifiersCVE-2026-42271CWE-78· Improper Neutralization of Special…

CVE-2026-42271 is a command injection vulnerability in BerriAI LiteLLM affecting versions 1.74.2 through before 1.83.7. The issue resides in the MCP server preview endpoints POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list. These endpoints accepted a full MCP server configuration in the request body, including stdio transport fields such as command, args, and env. When a request supplied a stdio configuration, LiteLLM attempted to connect to the specified MCP server by spawning the provided command as a subprocess on the proxy host. Because access to these endpoints required only a valid proxy API key and did not enforce an appropriate role check, any authenticated user, including holders of low-privilege internal-user keys, could cause arbitrary commands to be executed on the host with the privileges of the LiteLLM proxy process.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows authenticated attackers to execute arbitrary operating system commands on the LiteLLM proxy host in the security context of the proxy process. This can result in full compromise of the application host depending on the privileges of that process, including installation of malware, theft of secrets and API keys, modification of application state, pivoting to adjacent systems, and service disruption. CISA has added this CVE to the KEV catalog based on evidence of active exploitation.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, restrict or disable access to the vulnerable MCP preview endpoints, especially for low-privilege or broadly distributed API keys. Limit issuance of proxy API keys, enforce stronger authorization controls around MCP administration and testing functions, and isolate the LiteLLM proxy host to reduce blast radius. Monitor for suspicious subprocess creation by the LiteLLM service and block outbound or lateral movement paths from the proxy host where feasible. Per CISA guidance, discontinue use if mitigations are unavailable.

Remediation

Patch, then assume compromise.

Upgrade BerriAI LiteLLM to version 1.83.7 or later, which patches the vulnerable MCP preview behavior. Apply the vendor-provided fix and review any exposed deployments for unauthorized command execution. Because the flaw was exploitable by any authenticated API-key holder, rotate proxy API keys and other secrets that may have been accessible from the host, and investigate process execution logs and host telemetry for signs of abuse. If operating in an environment covered by CISA BOD 22-01, follow the applicable remediation guidance and timelines.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 1 / 1 TOTALView more in app
CVE-2026-42271-PoCMaturityPoCVerified exploit

This repository is a standalone Python proof-of-concept exploit for CVE-2026-42271, an authenticated OS command injection vulnerability in BerriAI LiteLLM MCP stdio test endpoints. The repo contains 8 files: documentation in README.md and docs/advisory.md, a reproducible vulnerable lab in docker-compose.yml, the exploit implementation in exploit/exploit.py, payload helpers in exploit/payload.py, a minimal requirements.txt, and a screenshots placeholder directory. The main exploit logic is in exploit/exploit.py. It uses requests to send authenticated POST requests to either /mcp-rest/test/tools/list or /mcp-rest/test/connection on a target LiteLLM instance. The script builds a JSON body with transport="stdio" and attacker-controlled command/args values, relying on the vulnerable server behavior of spawning the supplied command as a subprocess. The exploit supports selecting the endpoint, setting a target URL and API key, routing through an HTTP proxy, adjusting timeout, and running in an interactive blind-shell mode where each entered command is sent as a new exploit request. The helper module exploit/payload.py generates reusable payloads. It includes functions for generic payload creation, arbitrary shell command execution via bash -c, reverse shell generation, environment extraction by reading /proc/1/environ, and file-read payloads that redirect sensitive file contents into writable target-side files. The code explicitly notes that MCP SDK environment isolation prevents simple env dumping from revealing parent process secrets, so it instead targets /proc/1/environ to recover values such as LITELLM_MASTER_KEY. The exploit’s capabilities are substantial: authenticated remote code execution, blind interactive command execution, reverse shell payload generation, reading sensitive files, and extracting process environment variables. The README and code indicate that any valid API key is sufficient because the vulnerable endpoints lack proper role checks; in the default Docker deployment, the LiteLLM process runs as root, so successful exploitation yields root-level command execution inside the container. The docker-compose.yml file provides a reproducible environment with a pinned vulnerable LiteLLM v1.82.6 image on port 4000 and an optional fixed v1.83.7 image on port 4001. This confirms the repository’s purpose is both demonstration and reproducible exploitation of the vulnerability rather than mere detection. Overall, this is a real operational PoC exploit for authenticated web/network-based RCE against vulnerable LiteLLM deployments.

learner202649Disclosed May 20, 2026pythonyamlwebnetwork
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
LitellmLitellmapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures1

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity10

Community discussion across Reddit, Mastodon, and other social sources.