NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · LiteLLM

CVE-2026-42271: LiteLLM: Authenticated command execution via MCP stdio test endpoints

highCVSS 4.0 8.7 · 3.1 8.8ExploitedGHSA-v4p8-mg3p-g94g

LiteLLM proxy versions 1.74.2 up to 1.83.6 let any holder of a valid proxy API key run commands on the host through two MCP test endpoints. CISA lists the flaw as exploited. Upgrade to litellm 1.83.7, which restricts both endpoints to the PROXY_ADMIN role.

Published Apr 25, 2026 · Updated Jun 9, 2026 · Analysis Nov 2, 2026

What an attacker can do

The endpoints POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list preview an MCP server before it is saved. They took a full server configuration in the request body, including the command, args and env fields of the stdio transport. To test a stdio server, the proxy starts the command as a subprocess. So the caller chose which program ran, with which arguments and environment, under the proxy process's privileges.

The save endpoint was already limited to admins. These two test routes checked only for a valid API key, with no role check. A low-privilege internal-user key was enough. Keys for LiteLLM are often handed to many developers, apps and contractors, so the number of people who can reach this is large.

The result is arbitrary command execution on the proxy host. The proxy usually holds upstream model provider keys, the master key and database credentials in its environment, so a shell there exposes all of them and a path into the network behind it. The attacker needs only network access to the proxy and one valid key.

Who is affected

The litellm package on PyPI from 1.74.2 up to but not including 1.83.7. This applies to the LiteLLM proxy server. Check your version:

pip show litellm

For Docker deployments, check the image tag or run the same command inside the container.

litellm

Ecosystem
PyPI
Affected
>= 1.74.2, < 1.83.7
Fixed in
1.83.7
Check
pip show litellm

How to fix it

Upgrade to litellm 1.83.7 or later.

pip install --upgrade litellm==1.83.7

Both test endpoints now require the PROXY_ADMIN role, the same as the save endpoint. If you cannot upgrade at once, block POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list at your reverse proxy or API gateway.

CISA added the CVE to its Known Exploited Vulnerabilities catalog on 2026-06-08 with a due date of 2026-06-22 for US federal agencies. Its action: apply mitigations per vendor instructions, follow BOD 22-01 guidance for cloud services, or stop using the product if mitigations are unavailable.

CISA 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.

How to tell if you were hit

The advisory gives no signatures. Search proxy and gateway access logs for POST requests to the two test paths, especially from non-admin keys. On the host, look for child processes of the LiteLLM process that are not part of your normal MCP servers, such as shells, curl, wget or interpreters, and for new files or cron entries made by the proxy's user. Because the host's secrets were exposed to the command, rotate provider keys, the master key and database credentials if you find a hit. Beam records agent shell commands and MCP tool calls on developer machines, but it does not watch a proxy server.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

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.

Patches

Fixed in `1.83.7`. Both test endpoints now require the PROXY_ADMIN role, bringing them into line with the save endpoint.

Workarounds

If upgrading is not immediately possible, developers should block POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list at their reverse proxy or API gateway.

Credited to Youns92.

Questions

Is CVE-2026-42271 exploited in the wild?

Yes. CISA added it to the Known Exploited Vulnerabilities catalog on 2026-06-08. The EPSS score in the data is 0.91.

Does the attacker need to be an admin?

No. Any valid proxy API key worked, including low-privilege internal-user keys. The endpoints had no role check before 1.83.7.

What if I can't upgrade LiteLLM today?

Block POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list at the reverse proxy or API gateway. That is the workaround the advisory gives.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More LiteLLM vulnerabilities

All LiteLLM entries