Vulnerability record · CVE-2026-42271 · published 8 May 2026
CVE-2026-42271: LiteLLM MCP test endpoints allow authenticated OS command injection
Litellm · Litellm
LiteLLM versions 1.74.2 through before 1.83.7 expose two MCP preview endpoints (POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list) that accept a full server configuration, including the command, args and env fields of the stdio transport. When given a stdio configuration, the endpoints spawn the supplied command as a subprocess on the proxy host with the proxy process's privileges. The endpoints were gated only by a valid proxy API key with no role check, so any authenticated user could execute arbitrary commands.
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.
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:
Automated analysis
critical priorityThe flaw allows authenticated remote command execution on the AI gateway host, is listed in CISA KEV with a near-term due date, and has an EPSS probability above 0.83.
What it is
LiteLLM versions 1.74.2 through before 1.83.7 expose two MCP preview endpoints (POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list) that accept a full server configuration, including the command, args and env fields of the stdio transport. When given a stdio configuration, the endpoints spawn the supplied command as a subprocess on the proxy host with the proxy process's privileges. The endpoints were gated only by a valid proxy API key with no role check, so any authenticated user could execute arbitrary commands.
Impact
An attacker with any valid proxy API key, including a low-privilege internal-user key, gains arbitrary command execution on the LiteLLM proxy host under the proxy process's privileges. This enables host compromise, data theft and lateral movement from the AI gateway.
Attack surface
Reachable over the network via HTTP POST to the two MCP test endpoints; only a valid proxy API key is required, with no role check and no user interaction. The CVSS vector confirms network attack, low privileges and no UI.
Exploitation
CVE-2026-42271 was added to CISA KEV on 2026-06-08 with a 2026-06-22 remediation due date, and EPSS gives a 30-day probability of 0.83594 (99.669th percentile). No ransomware campaign use is documented in the record.
What to do
- Upgrade LiteLLM to version 1.83.7 or later, which contains the patch.
- Apply the Red Hat errata (RHSA-2026:27784, RHSA-2026:28960, RHSA-2026:30056) for OpenShift AI deployments.
- If immediate patching is not possible, restrict network access to the MCP test endpoints and rotate or revoke low-privilege proxy API keys.
- Enforce role-based authorization on administrative and MCP preview endpoints so internal-user keys cannot reach them.
- Follow CISA KEV required action: apply vendor mitigations, follow BOD 22-01 guidance for cloud services, or discontinue use of the product.
Detection
- Monitor proxy and application logs for POST requests to /mcp-rest/test/connection and /mcp-rest/test/tools/list, especially with stdio configurations containing command, args or env fields.
- Alert on unexpected child processes spawned by the LiteLLM proxy process, particularly shells or interpreters.
- Audit proxy API key usage for low-privilege internal-user keys calling MCP test endpoints.
- Review host process telemetry for command execution originating from the LiteLLM service account.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Exploitation in the wild
CISA added CVE-2026-42271 to the Known Exploited Vulnerabilities catalog on 8 June 2026 as "BerriAI LiteLLM Command Injection Vulnerability". Required action: Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable. Federal deadline 22 June 2026.
Affected products
2 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
| Link | Tags |
|---|---|
| https://github.com/BerriAI/litellm/releases/tag/v1.83.7-stable | ProductRelease Notes |
| https://github.com/BerriAI/litellm/security/advisories/GHSA-v4p8-mg3p-g94g | MitigationPatchVendor Advisory |
| https://access.redhat.com/errata/RHSA-2026:27784 | Third Party Advisory |
| https://access.redhat.com/errata/RHSA-2026:28960 | Third Party Advisory |
| https://access.redhat.com/errata/RHSA-2026:30056 | Third Party Advisory |
| https://access.redhat.com/security/cve/CVE-2026-42271 | Third Party Advisory |
| https://bugzilla.redhat.com/show_bug.cgi?id=2467924 | Third Party Advisory |
| https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42271.json | Third Party Advisory |
| https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-42271 | US Government Resource |
Track CVE-2026-42271 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2026-42271), CISA KEV, FIRST EPSS (scores of 2026-09-27). This page is refreshed as NVD updates the record.