Patchfirst
CVE-2026-42271 KEVPublic exploit High · 8.8 EPSS 91.4%

BerriAI LiteLLM Command Injection Vulnerability

BerriAI · LiteLLM

Summary

LiteLLM (by BerriAI) has a flaw in its MCP server preview endpoints, POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list, which accept a full stdio server configuration including command, args, and env fields. An authenticated attacker with any valid proxy API key, including low-privilege internal-user keys, can have the supplied command spawned as a subprocess on the proxy host with the proxy process's privileges, requiring only network access to the proxy and no user interaction or special configuration.

Official description · NVD

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.

Breakdown
84.1 / 100
Exploited
Yes, in CISA KEV
Reports
0
Tactics
2/15

How an attack unfolds

Based on mappings. Select a step to see the evidence.
  1. How attackers get in

  2. What they do

First seen exploited 31 days after disclosure. Public exploit code (Metasploit) was available 17 days before disclosure.

  1. Public exploit codeMetasploit17 days before
  2. Disclosedday 0
  3. First seen exploitedVulnCheck KEV evidenceAdded to CISA KEVEU database agrees+31 days

CISA KEV listing is when exploitation was confirmed, not necessarily the first attack.

techniques

2 , grouped by in kill-chain order, 2 cited passages 2

Initial AccessTA0001

Exploit Public-Facing Application T1190 Medium
AI mapping from the description · how it is exploited

Exploited via exposed HTTP API endpoints

POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list
From the official description (NVD) Original (opens in a new tab) ↗

ExecutionTA0002

Command and Scripting Interpreter T1059 Medium
AI mapping from the description · primary impact

Arbitrary command execution on proxy host

the endpoints attempted to connect, which spawned the supplied command as a subprocess
From the official description (NVD) Original (opens in a new tab) ↗

Detection

0 rules for this CVE · 244 general rules for its techniques

Rules for this CVE

0 that reference CVE-2026-42271 directly.

CVE-specific rules are not available in this build. Search SigmaHQ ↗

Sigma rules © SigmaHQ, Detection Rule License 1.1; linked, not reproduced.

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: litellm.

Upgrade to 1.84.0 or later

Fixes this CVE and 5 other known vulnerabilities in this package (CVE-2026-35029, CVE-2026-40217, +3).

pippip install "litellm>=1.84.0"

First fixed in 1.83.7 for CVE-2026-42271.

Affected versions

If you runUpgrade to
1.74.2 up to 1.83.71.84.0first fix for this CVE: 1.83.7

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

Also mentioned in 50 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

9 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close