Skip to main content
Mallory
HighExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2026-42271: Authenticated command execution in LiteLLM MCP preview endpoints

Published May 8, 2026 · Updated 1 day ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days24 mentions · peak 9 in a dayToday
CVSS8.7High · v4
EPSS91.4%100th percentile
CISA KEVYesAdded Jun 8, 2026
In the wildActivePer CISA KEV
Vendors
LitellmRed Hat
IdentifiersCVE-2026-42271CWE-862

CVE-2026-42271 is an authenticated arbitrary command execution vulnerability affecting LiteLLM versions 1.74.2 through versions before 1.83.7. Two Model Context Protocol (MCP) server preview endpoints accept complete server configurations, including attacker-controlled command, args, and env fields for the stdio transport. Testing a stdio connection launches the configured command as a subprocess with the privileges of the LiteLLM proxy process. The endpoints validate the caller's proxy API key but omit role-based authorization, allowing even low-privilege internal users to execute arbitrary commands on the proxy host. Version 1.83.7 adds the required administrative role checks.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

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

Successful exploitation compromises confidentiality, integrity, and availability within the permissions of the proxy process. Attackers can execute code, access environment variables and provider API credentials, alter accessible data, disrupt services, and deploy malware. Stolen credentials and access to connected services can enable unauthorized API consumption, data theft, and lateral movement. Host takeover is possible where the proxy process has sufficient privileges. Chaining this vulnerability with the separate Starlette authentication-bypass vulnerability CVE-2026-48710 can enable unauthenticated remote code execution.

Mitigation

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

If upgrading is not immediately possible, block POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list at the reverse proxy or API gateway. Remove administrative and test endpoints from direct internet exposure and restrict access through a VPN or independently authenticated reverse proxy. To reduce exposure to the associated authentication-bypass chain, enforce an allowlist of accepted Host header values. Review endpoint access logs and unexpected subprocess activity for exploitation evidence.

Remediation

Patch, then assume compromise.

Upgrade LiteLLM to version 1.83.7 or later. The fix requires the PROXY_ADMIN role for POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list, aligning their authorization with the MCP server save endpoint. For deployments also affected by CVE-2026-48710, upgrade Starlette to version 1.0.1 or later. Rotate the master key and all provider keys held by exposed vulnerable instances, and investigate possible compromise.

Public exploits

Exploits

2 exploits validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
CVE-2026-42271-PoCThis 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.learner202649 · Disclosed May 20, 2026 · python · yaml · web · networkOperationalCVE-2026-42271-LiteLLM-RCEThis repository is a small standalone Python proof-of-concept exploit for CVE-2026-42271 affecting BerriAI LiteLLM AI Gateway versions 1.74.2 through 1.83.6. The repo contains three files: a minimal .gitignore, a README describing the vulnerability and usage, and the main exploit implementation in exploit.py. The exploit targets two authenticated HTTP POST endpoints exposed by LiteLLM's MCP testing functionality: /mcp-rest/test/connection and /mcp-rest/test/tools/list. Its core capability is authenticated remote code execution by sending attacker-controlled MCP configuration data that populates command, args, and env fields. The script builds multiple payload variants to improve reliability across deployments: a shell-based variant using sh -c or cmd.exe /c, a Python-based variant using python3 -c with os.system(), and an additional variant that attempts to capture command output into temporary files. It also tries several possible JSON wrapper keys (mcp_config, config, mcp_server_config, server_config, or direct payload) to match differing server-side request schemas. Operationally, the script accepts a target URL, API key, command to run, endpoint selection, and SSL verification options. It iterates through both vulnerable endpoints and each payload variant, sends POST requests with Bearer authentication, and reports HTTP/JSON responses. The exploit is not merely a detector; it is intended to trigger actual command execution on the host. Because the payload is hardcoded/basic rather than modularized into a larger framework, the maturity is best classified as OPERATIONAL.amnsecurity · Disclosed Jul 7, 2026 · python · markdown · web · networkOperational
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
Red HatOpenshift Aiapplication
FAQ

Frequently asked questions

Is CVE-2026-42271 exploited in the wild?
Yes. As of Nov 24, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Jun 8, 2026.
Is there a public exploit for CVE-2026-42271?
Yes. Mallory tracks 2 public exploits or proofs of concept for CVE-2026-42271, the earliest disclosed May 20, 2026.
Is there a patch for CVE-2026-42271?
Upgrade LiteLLM to version 1.83.7 or later. The fix requires the PROXY_ADMIN role for POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list, aligning their authorization with the MCP server save endpoint.
What products are affected by CVE-2026-42271?
Litellm and Red Hat Openshift Ai.
How severe is CVE-2026-42271?
CVE-2026-42271 has a CVSS v4 score of 8.7 (High) and an EPSS score of 91.4% (100th percentile) as of Nov 24, 2026.
Activity feed

Recent activity

167 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
cyberveilleNews · Nov 21, 2026CVE-2026-40217 : Sandbox escape dans LiteLLM ajoutée au catalogue KEV de la CISA | CyberVeilleUnknownRead more ↗cryptika blogNews · Nov 20, 2026Hackers Actively Scan LiteLLM AI Servers for Critical Flaws Enabling RCE Attacks | Cryptika CybersecurityA command execution vulnerability in LiteLLM MCP test endpoints allows supplied commands to run with the proxy's privileges. Exploitation normally requires a valid proxy API key, including a low-privilege internal-user key. Attackers are actively targeting it in combination with CVE-2026-48710 to bypass authentication and achieve unauthenticated remote code execution. The article reports prior exploitation and its addition to CISA's Known Exploited Vulnerabilities catalog on June 8, 2026.Read more ↗cyber security newsNews · Nov 20, 2026Hackers Actively Scan LiteLLM AI Servers for Critical Flaws Enabling RCE AttacksA command execution vulnerability in LiteLLM versions 1.74.2 through versions before 1.83.7 allows an attacker with a valid proxy API key, including a low-privilege internal-user key, to execute supplied commands with the proxy's privileges. Chaining it with CVE-2026-48710 bypasses authentication and enables unauthenticated remote code execution. Attackers are actively scanning the MCP test endpoint and submitting command-execution probes. The article reports prior exploitation and inclusion in CISA's Known Exploited Vulnerabilities catalog on June 8, 2026.Read more ↗malware newsNews · Nov 16, 2026Scans for LiteLLM/Starlette (CVE-2026-42271, CVE-2026-48710), (Mon, Nov 16th) - Malware News - Malware Analysis, News and IndicatorsOne of two vulnerabilities discussed in connection with LiteLLM/Starlette that can reportedly be chained to achieve unauthenticated remote code execution. Honeypots observed requests appearing to attempt exploitation; successful compromise is not confirmed. The content does not specify which product this individual CVE affects.Read more ↗
+39 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

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, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence2Every report linking this CVE to a named adversary.
Associated malware13Malware families linked to this CVE, with evidence and IOCs.
Detection signatures2YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity120Community discussion across Reddit, Mastodon, and other social sources.