---
id: "CVE-2026-42271"
kind: "vulnerability"
aliases: ["CVE-2026-42271"]
title: "LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format"
severity: "critical"
cvss: 8.8
epss: null
exploited: true
status: "resolved"
category: "ai-tooling"
products: [{"name": "BerriAI LiteLLM", "fixed": [], "affected": "", "ecosystem": "vendor"}, {"name": "litellm", "fixed": ["1.83.7"], "affected": ">= 1.74.2, < 1.83.7", "ecosystem": "pypi"}, {"name": "litellm", "fixed": ["1.83.7"], "affected": ">= 1.74.2, < 1.83.7", "ecosystem": "vendor"}, {"name": "redhat openshift ai", "fixed": ["2.25.8"], "affected": ">= 2.25, < 2.25.8", "ecosystem": "vendor"}, {"name": "redhat openshift ai", "fixed": ["3.3.4"], "affected": ">= 3.3, < 3.3.4", "ecosystem": "vendor"}, {"name": "redhat openshift ai", "fixed": [], "affected": "= 3.4", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["ai-tooling", "exploited", "litellm", "llm-gateway", "mcp", "poc-public", "python", "self-hosted"]
not_affected_if: ["managed-hosting"]
published_at: "2026-05-08T04:16:21+00:00"
first_seen_at: "2026-10-23T19:11:51+00:00"
updated_at: "2026-10-23T23:44:51+00:00"
sources: [{"source": "kev", "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2026-42271", "first_seen_at": "2026-10-23T19:11:51+00:00"}, {"source": "analyst", "url": null, "first_seen_at": "2026-10-23T20:37:06+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-42271", "first_seen_at": "2026-10-23T23:44:51+00:00"}]
---

# LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format

LiteLLM proxy's MCP test endpoints (POST /mcp-rest/test/connection and /mcp-rest/test/tools/list) accept a stdio server config and spawn its command on the proxy host. They only need a valid proxy API key, with no role check, so any low-privilege key holder gets arbitrary command execution. Exploited in the wild and a Metasploit module is public. CSA reports it chains with a Starlette Host-header auth bypass for unauthenticated RCE.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- vendor:BerriAI LiteLLM affected ? fixed ?
- pypi:litellm affected >= 1.74.2, < 1.83.7 fixed 1.83.7
- vendor:litellm affected >= 1.74.2, < 1.83.7 fixed 1.83.7
- vendor:redhat openshift ai affected >= 2.25, < 2.25.8 fixed 2.25.8
- vendor:redhat openshift ai affected >= 3.3, < 3.3.4 fixed 3.3.4
- vendor:redhat openshift ai affected = 3.4 fixed ?

## How to check

Run 'pip show litellm' (or check the container image tag). Versions >= 1.74.2 and < 1.83.7 are vulnerable. Check proxy access logs for POST /mcp-rest/test/connection or /mcp-rest/test/tools/list from non-admin keys, especially bodies with transport stdio and a command like bash or sh. Check for unexpected child processes of the proxy. Snort rule 1:66993 detects bash attempts. If these were reachable, treat the host as compromised and rotate the provider keys and the master key stored on it.

## Fix

Upgrade litellm to 1.83.7 or later. Both endpoints then require PROXY_ADMIN (non-admin keys get 403), and the stdio command is limited to an allowlist (deno, docker, node, npx, python, python3, uvx). CSA also advises Starlette 1.0.1 or later for the Host-header chain. Until you upgrade, block /mcp-rest/test/* at the reverse proxy and do not expose the proxy to untrusted networks.

## Timeline

- 2026-10-23T19:11:51+00:00 kev https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2026-42271
- 2026-10-23T20:37:06+00:00 analyst — GitHub advisory GHSA-v4p8-mg3p-g94g: LiteLLM 1.74.2 to 1.83.6 affected, fixed in 1.83.7. Exploited (CISA KEV 2026-06-08), Metasploit module public. Severity kept critical because of KEV exploitation and the PoC (CNA rates it 8.7 high). CSA reports a chain with a Starlette Host-header bypass (CVE-2026-48710) that gives unauthenticated RCE, from one secondary source I did not verify.
- 2026-10-23T23:44:51+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-42271

## Documents

- [advisory] GHSA-v4p8-mg3p-g94g LiteLLM MCP stdio test endpoints https://github.com/advisories/GHSA-V4P8-MG3P-G94G
- [discussion] CSA research note: LiteLLM CVE-2026-42271 exploitation https://labs.cloudsecurityalliance.org/research/csa-research-note-litellm-cve-2026-42271-ai-gateway-exploita/
- [mentions] Horizon3: LiteLLM unauth RCE chaining CVE-2026-42271 + CVE-2026-48710 https://horizon3.ai/attack-research/vulnerabilities/cve-2026-42271-chained-with-cve-2026-48710/
- [mitigation] Snort rule 1:66993 LiteLLM command injection https://snort.org/rule_docs/1-66993
- [poc] Metasploit module litellm_mcp_test_cmd_injection https://www.rapid7.com/db/modules/exploit/multi/http/litellm_mcp_test_cmd_injection/

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
