Off Guard: Breaking LiteLLM from authentication bypass to cloud compromise Nearly 1 in 10 publicly accessible LiteLLM instances accept a default master key or require no authentication, exposing cloud AI infrastructure to root-level remote code execution and IAM theft, according to research presented at DEF CON 34. The researchers found an MCP authentication bypass (CVE-2026-59822) that allows arbitrary Bearer tokens to create valid sessions, affecting hundreds of internet-facing instances, and a post-auth cloud credential theft vector via the pass-through endpoint feature. All vulnerabilities have been patched, and CVE-2026-59822 has been added to CISA's Known Exploited Vulnerabilities catalog. Off Guard: Breaking LiteLLM from authentication bypass to cloud compromise How default keys, unauthenticated MCP sessions, and custom code guardrails expose cloud AI infrastructure to root-level remote code execution and IAM theft. Nearly 1 in 10 publicly accessible LiteLLM instances accept a default master key or require no authentication at all. We found this while scanning roughly 3,000 internet-facing deployments of the most popular open-source LLM gateway. The usual concern with that kind of exposure is LLMjacking -someone using the credentials to run API calls on your bill - however, we wanted to check whether an attacker could do worse than that: could they achieve code execution on the host? Furthermore, could they exploit this to compromise the wider environment? We decided to use Claude Code to work through LiteLLM's codebase, looking for features that accept user-controlled input and pass it to an execution context. We found multiple issues, as detailed below. Key findings: MCP authentication bypass via the MCP endpoint CVE-2026-59822 - an arbitrary Bearer token can create a valid session; confirmed as exploitable across hundreds of Internet-facing instances. 9.6% of 3,074 public instances at the time of this research accepted the default master key sk-1234 or required no authentication at all. In these cases, the RCE is effectively pre-auth. Unauthenticated access as admin by default no CVE assigned; fixed alongside CVE-2026-59821 - when no authentication is configured, all users are granted PROXY ADMIN access. Post-auth cloud credential theft vector via the pass-through endpoint feature, as it lacks URL validation. This isn’t considered a vulnerability and therefore wasn’t fixed or assigned a CVE, meaning the technique remains abusable in post-auth scenarios. However, similarly to the above, when chained with a default master key or missing authentication, this is effectively pre-auth. All vulnerabilities have since been responsibly disclosed to LiteLLM and have patches available. CVE-2026-59822 has been added to CISA's Known Exploited Vulnerabilities catalog, and we observed it being exploited in the wild via our honeypot infrastructure. This research was previously presented at DEF CON 34. Background: What is LiteLLM? LiteLLM is an open-source AI gateway that provides a unified OpenAI-compatible API for over 100 LLM providers, including OpenAI, Anthropic, AWS Bedrock, Azure, and Google Vertex AI. Organizations route their LLM traffic through it so they can centrally manage their API keys, enforce budgets, apply guardrails, monitor usage, etc. LiteLLM is one of the most popular open-source AI gateways, present in approximately one-third of cloud environments according to Wiz data. LiteLLM can hold API keys for every configured LLM provider, process every prompt and response that flows through it, and connect to external tools via MCP. A compromised LiteLLM instance means compromised AI infrastructure, and, as we'll show, often the cloud environment it runs in. The conventional risk model for this is LLMjacking: an attacker makes API calls on the organization's behalf, runs up costs, and exfiltrates whatever provider keys are configured. While this is indeed a proven real-world risk, LiteLLM isn't just a credential store. It executes server-side Python on every inference request, can proxy requests to arbitrary internal URLs, and connects to internal tools and systems via MCP. Therefore, we wanted to know what an attacker could actually do with a compromised instance beyond just API abuse. Searching for Attack Paths Using Claude Code, we went through guardrails, pass-through endpoints, model configuration, hook systems, and the MCP layer. Three features had obvious attack surface: MCP authentication handler user api key auth mcp.py : a separate auth path for the Model Context Protocol endpoint Custom code guardrails guardrail endpoints.py : administrators submit Python code that the server passes to exec compile ... Pass-through endpoints pass through endpoints.py : proxy routes that forward requests to arbitrary URLs with no validation MCP Authentication Bypass CVE-2026-59822 LiteLLM supports MCP Model Context Protocol , a standard for connecting AI models to external tools and data sources. The MCP endpoint has its own authentication handler, separate from the main LiteLLM auth. It was designed to support a dual authentication model: LiteLLM API keys for direct users, and OAuth2 token passthrough for users authenticating via upstream providers like GitHub or Atlassian. The idea is simple - if a Bearer token isn't a valid LiteLLM key, pass it through to the upstream MCP server as an OAuth2 token. The problem is in the fallback logic. When a token fails LiteLLM validation, the handler doesn't distinguish between "this is a legitimate OAuth2 token meant for an upstream provider" and "this is complete garbage." It catches the 401 error and silently returns an empty auth object - granting access as if the request were authenticated: elif oauth2 headers: try: validated user api key auth = await user api key auth api key=litellm api key, request=request except HTTPException as e: if e.status code in 401, 403 : validated user api key auth = UserAPIKeyAuth bypass else: raise This branch triggers for any request with an Authorization header - which is every normal Bearer token request. Any garbage token fails validation with a 401, and the handler proceeds as if nothing happened. The exploit is one request, as demonstrated below. Note that Authorization: Bearer a , containing a single character, is enough to establish a fully authenticated MCP session: POST /mcp/ HTTP/1.1 Host: