Attackers are scanning the internet for exposed LiteLLM servers to chain two flaws into unauthenticated remote code execution. Cyber Security News reported on November 20, 2026 that Johannes Ullrich of the SANS Internet Storm Center saw honeypot requests to /mcp-rest/test/tools/list that appear to target both CVE-2026-42271 (a command-execution bug in LiteLLM) and CVE-2026-48710 (the Starlette "BadHost" Host-header bug). If you run a LiteLLM proxy for Claude Code, Codex or other agents, upgrade LiteLLM to 1.83.7 or later and Starlette to 1.0.1 or later, take the test endpoints off the public internet, and rotate the keys the proxy holds if it was ever exposed.
LiteLLM is an LLM gateway: one server in front of many model providers. That makes it a concentrated target. A process that can read the proxy's environment can read every provider key behind it.
TL;DR
| Question | Answer |
|---|---|
| Am I affected? | LiteLLM 1.74.2 up to but not including 1.83.7, or any deployment whose dependencies include Starlette 1.0.0 or earlier, with the proxy reachable by an attacker |
| Is it exploited? | Yes. CVE-2026-42271 is in CISA KEV (added June 8, 2026) and new scans were reported on November 20, 2026 |
| Is there a fix? | LiteLLM 1.83.7+ and Starlette 1.0.1+ |
| Do attackers need a login? | Not when the two bugs are chained. CVE-2026-42271 alone needs a valid proxy API key |
| Does data leave my machine? | The exploit runs on the gateway host. Anything that host's process can read, including provider keys, is in scope |
| What do I do now? | Upgrade, block /mcp-rest/test/, review logs, rotate keys if exposed |
What happened
The Cyber Security News report, based on the SANS Internet Storm Center's honeypot data, says the odd requests arrived over a weekend and went to /mcp-rest/test/tools/list. The request carried a fake bearer token and a body asking the server to run the id command through the stdio transport, which is a common way to test whether code runs. The scanners also tried unusual Host values, such as localhost] and [localhost, which the report says likely aim to get around filters written for the public proof-of-concept.
None of this is new as a vulnerability. Ullrich noted that exploitation was reported back in July and that attackers keep tweaking old exploits to dodge filters. What is new is the renewed scanning, which means servers that missed the earlier warnings are being found. This is the second LiteLLM issue in KEV that Beam has covered this month; see CVE-2026-40217, the guardrail sandbox escape.
The mechanism, step by step
Step 1: A test endpoint that runs commands
LiteLLM's MCP support lets an admin preview a server before saving it. Two endpoints do this: POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list. According to the GitHub advisory GHSA-v4p8-mg3p-g94g, they accepted a full server configuration in the request body, including the command, args and env fields used by the stdio transport. With a stdio config, the proxy spawns the command as a subprocess on the host, with the proxy's own privileges. Horizon3.ai's write-up describes this as command injection in the MCP test endpoints.
Alone, this needed a valid proxy API key. The report says even a low-privilege internal-user key was enough. That is why it was first read as an authenticated bug.
Step 2: BadHost removes the login
The second flaw is in the web framework underneath. The Starlette advisory GHSA-86qp-5c8j-p5mr says that in affected versions the HTTP Host header was not validated before being used to rebuild request.url. Routing uses the raw HTTP path, while request.url is rebuilt from the Host header, so a malformed header can make request.url.path differ from the path that is actually routed. Code that makes an access-control decision on request.url.path can then be fooled.
Horizon3.ai says it validated that this bypass works against the authentication mechanism entirely in affected LiteLLM deployments, and assessed the chain at CVSS 10.0. Severity scores differ by source: the LiteLLM advisory rates CVE-2026-42271 High (CVSS v4 8.7), and the Starlette advisory rates CVE-2026-48710 Moderate (CVSS v3.1 6.5). Only the chain is scored 10.0. Check the advisories for the numbers you report internally.
Step 3: Code runs on the gateway
With the auth gate skipped, the attacker posts a stdio config to the test endpoint. The command runs on the proxy host. From there the attacker can read environment variables and stored provider keys, then run up costs or reach connected data. The report points to the earlier poisoned-release incidents as a reminder: one stolen key led to a bad package, covered in our post on the LiteLLM 1.107.0 compromise.
Timeline
| Date | Event |
|---|---|
| April 20, 2026 | CVE-2026-42271 disclosed (per Horizon3.ai) |
| May 8, 2026 | LiteLLM 1.83.7 released; it requires the PROXY_ADMIN role for the two test endpoints |
| May 26, 2026 | Starlette BadHost (CVE-2026-48710) publicly disclosed |
| June 1, 2026 | Horizon3.ai validates the chained path |
| June 8, 2026 | CVE-2026-42271 added to CISA KEV |
| Weekend before November 20, 2026 | SANS ISC honeypots see scanning (exact dates not given); coverage published November 20 |
Beam's own records are at , and the LiteLLM tool page.
Why an exposed AI gateway is a rich target
Wiz researchers, cited in the report, scanned 3,074 internet-facing LiteLLM instances and found 294 (9.6%) that accepted a default master key or had no authentication at all. Past activity also included guesses at master keys such as sk-1234 and attempts to create new API keys and admin accounts. For the admin-side risks, see LiteLLM CVE-2026-114612 on salt-key reuse. For what attackers do with stolen model keys afterwards, see GTIG and Mandiant on LLMjacking.
Why "needs a valid key" is weaker than it sounds
CVE-2026-42271 was filed as an authenticated bug, and many teams triage those lower. Three things erode that comfort. First, the required key can be a low-privilege internal-user key, and those get handed out widely: to scripts, to CI, to every developer who points an agent at the gateway. Second, keys leak. Infostealers now go after agent credentials on developer machines, as we described in the WardenStealer coverage. Third, BadHost removes the requirement entirely on unpatched Starlette, so the "authenticated" label stops mattering. When two medium-looking bugs combine into a critical one, the dependency tree is part of your attack surface: patching the application alone is not enough, and a lockfile that pins an old Starlette can quietly undo a LiteLLM upgrade.
How to write defences that survive the next exploit tweak
The scanners are already varying their Host values to slip past filters built around the first public proof-of-concept. The ISC advice in the report is to filter on the flaw, not on one exploit string. In practice:
- Allow-list hostnames. Accept only the exact Host values your gateway serves. Anything else gets a 400 at the reverse proxy, before the application sees it.
- Reject impossible characters. Square brackets in a non-IPv6 Host, spaces, or control characters never belong in a hostname.
- Validate before you build URLs. If you write your own ASGI middleware, check the hostname before combining it into a URL used for authorization.
- Shrink the surface. The ISC calls reducing attack surface the most important step after patching. The test endpoints are a preview feature; if nobody on your team uses them from the network, block them outright.
Blocking by a single payload string (such as the id command) is not a defence. The attacker's real payload will not be id.
What this means if you run AI coding agents
Many teams put a LiteLLM proxy between Claude Code, Codex or CI jobs and their model providers. The laptop is not the vulnerable part; the gateway is. Work through this list:
- Find your proxies. Check dev servers, CI runners and containers, not just production. Look for anything listening that you did not put behind a VPN.
- Check versions. Run
pip show litellm starletteon the host, or inspect the image tag. You want LiteLLM 1.83.7 or later and Starlette 1.0.1 or later. - Upgrade both. The advisory-listed fix for LiteLLM is 1.83.7. Make sure the Starlette pin in your lockfile or image is also 1.0.1+, since the BadHost bug lives in that dependency.
- Cut exposure. Block
/mcp-rest/test/at your reverse proxy if you do not use it. Keep admin and test endpoints on a VPN or behind an authenticated proxy. Allow only your real hostnames; as the ISC advises, reject any Host value with characters that never belong in a hostname. - Hunt in logs. Search for requests to
/mcp-rest/test/connectionand/mcp-rest/test/tools/list, Host values likelocalhost],[localhost,127.0.0.1]orlitellm.proxy, the user agentPython/3.14 aiohttp/3.14.5, and request bodies with"transport": "stdio". Also look for unexpected child processes of the proxy. - Rotate if exposed. If a vulnerable server was reachable, rotate the master key and every provider key it held, then check provider dashboards for unfamiliar usage.
If you also use LiteLLM's MCP features, treat any stdio server config as code. A config with a command field is a program that will run on the host.
What Beam can and cannot do here
Beam is local security and observability for coding agents on the developer's machine. It does not patch, firewall or monitor a LiteLLM server, and it cannot see requests arriving at your gateway.
What it can do is cover the laptop side of the same risk. beam scan --mcp checks an MCP configuration for risky patterns and version pinning before you run it, which is useful when a config contains a stdio command; the scan is heuristic, not a full malware analysis. Beam's PreToolUse hooks for Claude Code and Codex can deny risky tool calls, and Beam redacts secrets before storage. That is hook-based, not a kernel sandbox. For MCP-focused guidance see MCP security: a practical guide. Server-side patching is on you.
Frequently asked questions
What is CVE-2026-42271 in LiteLLM?
A command-execution flaw in LiteLLM's MCP test endpoints. They accept a full stdio server configuration (command, args, env) and run it as a subprocess on the proxy host. On its own it needs a valid proxy API key.
What is the Starlette BadHost bug, CVE-2026-48710?
Starlette before 1.0.1 did not validate the HTTP Host header before rebuilding request.url. A malformed header can make the URL path differ from the path used for routing, so an access-control check can be skipped.
Is LiteLLM CVE-2026-42271 exploited in the wild?
Yes. CISA added it to the Known Exploited Vulnerabilities catalog on June 8, 2026, and a report dated November 20, 2026 describes fresh internet scanning that targets both CVEs.
Which LiteLLM and Starlette versions are safe?
LiteLLM 1.83.7 or later (the affected range is 1.74.2 up to but not including 1.83.7) and Starlette 1.0.1 or later. Check with pip show litellm starlette.
How do I know if my LiteLLM server was attacked?
Search web logs for requests to /mcp-rest/test/connection or /mcp-rest/test/tools/list, unusual Host values such as localhost] or [localhost, and unexpected child processes of the proxy. If the server was exposed and unpatched, rotate the master key and every provider key.
I cannot upgrade today. What is the workaround?
Block the /mcp-rest/test/ routes at your reverse proxy, keep admin and test endpoints off the public internet, allow only known Host values, and rotate keys the proxy holds.
Does this affect Claude Code or Codex on my laptop?
Not directly. The bug is in the server that agents may call through. If your agents route through a LiteLLM gateway, a compromised gateway exposes the provider keys they use, so patch the server and rotate keys.
Related reading
- LiteLLM CVE-2026-40217: CISA KEV guardrail sandbox RCE
- LiteLLM 1.107.0 PyPI and Docker compromise
- LiteLLM CVE-2026-114612: salt key reuse and proxy admin RCE
- MCP security: a practical guide
- November 2026 attacks timeline
Sources: Cyber Security News, Horizon3.ai, LiteLLM advisory GHSA-v4p8-mg3p-g94g, Starlette advisory GHSA-86qp-5c8j-p5mr.
Versions, dates and scan reports are accurate as of November 20, 2026. Check the advisories for newer fixed versions.

