Skip to the content
AI and Cybersecurity Learning and Practice Center Test automation Open the Learning Center

IncidentAI infrastructure

LiteLLM: any Bearer token opened the MCP gateway, and attackers used it

HighLiteLLM (BerriAI)WizCISA

LiteLLM is the open-source gateway many teams put in front of their model providers and MCP servers. Before version 1.84.0, its MCP Streamable HTTP endpoint accepted any Bearer token: when key validation failed, the handler fell through to an OAuth2 passthrough fallback and carried on with an empty identity, so an unauthenticated request got an authenticated MCP session. The fix (PR 26463) shipped in 1.84.0 in May and the GitHub advisory followed on June 30; Wiz's Amitai Cohen and Yaara Shriki published the research. By July 7 Wiz was seeing the bypass used against its honeypots, with requests as small as "Authorization: Bearer x" listing models, and on September 2 CISA added CVE-2026-59822 to its Known Exploited Vulnerabilities catalog with a September 16 deadline for federal agencies. Wiz's September 9 write-up chains it with a post-authentication code execution flaw in custom code guardrails (CVE-2026-59821, fixed in 1.82.0) and found that 9.6 percent of 3,074 public instances accepted the default master key sk-1234 or required no authentication at all.

Replay the attack step by step in the Learning Center

How it happened

  1. The MCP endpoint validated the Bearer token, caught the failure and returned an empty auth object instead of rejecting the request.
  2. The same fix closed a second bypass: the public-route check looked for '.well-known' anywhere in the URL, so '?.well-known' in a query string skipped protection on MCP routes.
  3. Inside, an attacker reaches the configured provider API keys (LLMjacking), the MCP servers behind the gateway (databases, Slack, Jira, CI), and through pass-through endpoints the cloud metadata service; custom code guardrails ran unsandboxed Python (CVE-2026-59821).
  4. Wiz's honeypots saw the bypass in use by July 7, before the CISA listing on September 2.

Impact

Unauthenticated access to every MCP tool and provider key behind an exposed LiteLLM gateway, and a path to cloud credentials and code execution on the container; exploitation confirmed in the wild.

The fix

Upgrade to LiteLLM 1.84.0 or later (1.82.0 fixes the guardrail code execution), set a strong master key rather than sk-1234, rotate the provider keys and MCP credentials the gateway held, review MCP session logs, and keep the gateway off the public internet behind an authenticating proxy.

Lessons

  • A failed authentication check must end the request; a fallback that supplies a default identity is an open door, whatever the token.
  • An AI gateway is a control plane: it holds every provider key and every MCP connection, so it needs the same exposure rules as a cloud console.
  • Default credentials in AI infrastructure are being scanned for; change them before the first deploy.
  • Patch what is on the KEV list first: the gap between the fix (May) and the listing (September) was four months of exposure.

Sources