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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| BerriAI | litellm | >= 1.74.2, < 1.83.7 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | airflow-3 | 3.2.2-r7 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Metasploit 1 module
-
BerriAI LiteLLM Proxy MCP Test Endpoint Command Execution
exploit/multi/http/litellm_mcp_test_cmd_injection
GitHub 2 repositories
-
learner202649/CVE-2026-42271-PoC ★ 1 · May 20, 2026
The code for personally reproducing the corresponding vulnerability
-
HORKimhab/CVE-2026-42271 ★ 0 · Jun 9, 2026
CVE-2026-42271 - Draft
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Automated scanner template
A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.
- LiteLLM - Command Injection http/cves/2026/CVE-2026-42271.yaml
Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | litellm | >= 1.74.2, < 1.83.7 | 1.83.7 | GHSA-v4p8-mg3p-g94g |
Advisories 2
- WID-SEC-2026-1288 LiteLLM: Mehrere Schwachstellen BSI CERT-Bund (WID) · Jun 25, 2026
- NCSC-2026-0137 Kwetsbaarheden verholpen in LiteLLM door BerriAI NCSC-NL (Netherlands) · May 11, 2026