POST /mcp-rest/test/connectionPOST /mcp-rest/test/tools/listBoth endpoints accept a complete MCP server configuration in the JSON request body, including the Cmd, args, and env fields that the stdio transport uses to launch server processes . When an authenticated user calls either endpoint with this configuration, LiteLLM takes the supplied Cmd value and spawns it as a subprocess on the host machine, running it with the same operating system privileges as the LiteLLM proxy process itself
.
Originally, BerriAI disclosed this as an authenticated remote code execution bug—an attacker needed a valid API key to reach the endpoints, and there was no role-based check to restrict who could call them. Even a low-privilege internal user with any valid proxy API key could execute arbitrary commands on the host . But the story didn't end there.
The second vulnerability is CVE-2026-48710, nicknamed "BadHost" by researchers. This is a host-header validation flaw in Starlette, the lightweight ASGI framework that underpins FastAPI, vLLM, and thousands of other Python web applications—including LiteLLM . All Starlette versions from 0.8.3 through 1.0.0 are affected
.
The root cause is a parser disagreement between how Starlette routes incoming requests and how it reconstructs the URL for application logic . The ASGI routing layer uses the raw HTTP path from the request to decide which endpoint handles it. But
request.url—the URL that application middleware and decorators see—is rebuilt by concatenating the raw Host header value with the request path, without proper validation .
By injecting URI authority-to-path delimiter characters such as ? or # into the Host header, an attacker can make request.url.path appear completely different from the actual routed path . The middleware sees a harmless path like
/, while the router forwards the request to the real target endpoint behind the scenes. Any path-based authentication middleware that trusts request.url.path can be bypassed trivially .
LiteLLM's authentication decorator checks request.url.path to determine whether a request needs a valid API key. The BadHost bypass lets an attacker manipulate that URL so the authentication middleware sees a path that does not require authentication, while the ASGI router simultaneously dispatches the request to one of the vulnerable MCP command injection endpoints .
This removes the single access-control gate that stood between the internet and arbitrary command execution. An attacker with no credentials and no prior access to the network can send a single crafted HTTP request that bypasses authentication entirely and runs operating system commands on the LiteLLM proxy host . Horizon3.ai confirmed the full chain works and assigned it a combined CVSS score of 10.0—maximum severity—because it achieves unauthenticated remote code execution
.
Successful exploitation gives attackers command execution with the privileges of the LiteLLM proxy process. From there, the threat surface expands quickly:
CISA adding CVE-2026-42271 to the KEV catalog on June 8, 2026, confirms that the vulnerability is not theoretical—attackers are actively weaponizing it right now . Under the Binding Operational Directive 22-01, all U.S. federal civilian executive branch agencies must patch KEV-listed vulnerabilities within an assigned remediation timeframe. CISA also strongly recommends that all organizations, public and private, treat KEV additions as emergency patching priorities
.
The fix for the chained exploit requires updates on two fronts, plus several defense-in-depth measures to address credential exposure:
Host headers against the URL specification and ignores headers that contain invalid characters, preventing the path-confusion trick that powers the authentication bypass POST /mcp-rest/test/connectionPOST /mcp-rest/test/tools/listHost headers The combined CVSS 10.0 severity, active exploitation in the wild, and CISA's KEV designation mean organizations running LiteLLM or Starlette-powered services should treat this as an emergency patch-and-rotate event. The window between active exploitation and credential exfiltration is already open.
Comments
0 comments