BerriAI LiteLLM
LiteLLM: Authenticated command execution via MCP stdio test endpoints
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 1.74.2, < 1.83.7
Fixed in 1.83.7
Mitigation
Upgrade litellm to 1.83.7 or later.
References
- Vendor advisory github.com/BerriAI/litellm/security/advisories…
- Release notes github.com/BerriAI/litellm/releases/tag/v1.83.…
Timeline
Days relative to CVE publicationFirst public PoC 12 days after publication; added to CISA KEV 31 days after publication. First PoC: learner202649/CVE-2026-42271-PoC (created 20 May 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs · 1 informational
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| learner202649/CVE-2026-42271-PoC | 20 May 2026 +12 d | 1 | PoC |
Informational 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| HORKimhab/CVE-2026-42271 | 9 Jun 2026 +32 d | 0 | Informational · write-up |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| Metasploit | Metasploit exploit: BerriAI LiteLLM Proxy MCP Test Endpoint Command Execution (exploit/multi/http/litellm_mcp_test_cmd_injection) | 19 Jun 2026 | 14 Nov 2026 |
| nuclei template | nuclei template: LiteLLM - Command Injection | 2 Jun 2026 | 14 Nov 2026 |
PoC characteristics
What to hunt for in your logs · from 1 PoC repoPOST /mcp-rest/test/tools/list
- Key headers
Authorization: Bearer sk-litellm-master-key- Content-Type
application/json- Ports
- 4000
- Seen in
- 1 repo: learner202649/CVE-2026-42271-PoC
- Evidence
- learner202649/CVE-2026-42271-PoC/README.md:43 learner202649/CVE-2026-42271-PoC/README.md:155
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/mcp-rest/test/tools/list(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET [4000] (msg:"GG PoC-Monitor CVE-2026-42271 BerriAI litellm exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/mcp-rest/test/tools/list"; http.header; content:"Authorization: Bearer sk-litellm-master-key"; nocase; reference:url,poc.griffinguard.io/cve/CVE-2026-42271; classtype:web-application-attack; sid:9587031; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: BerriAI litellm exploit attempt (CVE-2026-42271)
id: gg-pocmon-cve-2026-42271-9587031
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-42271. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-42271
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/mcp-rest/test/tools/list'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.42271