/

CVE-2026-59822

Severity:

HIGH RISK

(8.2)

Broken Auth Fallback (CWE-287) in LiteLLM MCP HTTP

CVE-2026-59822

Analyzed

Vulnerability type

Category:

Authentication and Authorization Bypass

CWE:

CWE-287, CWE-306

Impact:

Unauthorized Access to MCP Tooling and Backend Capabilities

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A flawed authentication fallback in LiteLLM's MCP Streamable HTTP endpoint lets attackers bypass LiteLLM key validation by crafting a specific Authorization header.

When this OAuth2 passthrough path is triggered, requests can reach MCP tooling without a valid gateway key, exposing backend tools to unauthenticated access.

Affected context

The vulnerability occurs in LiteLLM deployments that expose the MCP Streamable HTTP endpoint and rely on LiteLLM key-based authentication to protect access to MCP tools.

It becomes relevant when the gateway is configured to accept Authorization headers and includes an OAuth2 passthrough or fallback mechanism.

In such configurations, mis-handled error paths in key validation can result in requests being treated as authenticated even when they do not present a valid LiteLLM key.

Exploit preconditions

  • Attack surface: Public or internal LiteLLM MCP Streamable HTTP endpoint over HTTP(S)
  • Required access: Network reachability to the LiteLLM gateway; no valid LiteLLM key is required
  • Trigger point: Submission of requests with a crafted or fabricated Authorization header that causes LiteLLM key validation to fail and invoke the OAuth2 passthrough fallback
  • Why exploitation is possible: The fallback path replaces failed key validation with an empty UserAPIKeyAuth() object, which is treated as a successful authentication state, allowing requests to proceed to MCP tooling without enforcing key checks

Why this happens

This issue stems from incorrect handling of authentication failures within a multi-path auth flow combining LiteLLM key validation and OAuth2 passthrough.

Instead of treating failed key validation as a hard deny, the code constructs an empty UserAPIKeyAuth() object in a fallback path, effectively representing a user context with no associated key.

That empty context is still treated as authenticated, creating a classic CWE-287: Improper Authentication condition and overlapping with CWE-306: Missing Authentication for Critical Function, since sensitive MCP tooling is reachable without proof of identity.

Abstractly, the bug class is an insecure error-handling pattern where authentication failures fall back to permissive defaults instead of explicit rejection.

Potential impact

  • Attackers can make unauthenticated calls to MCP tooling exposed through LiteLLM
  • MCP tools may be used to invoke privileged backend actions (e.g., data access, system commands, integrations) without a valid gateway key
  • Abuse of AI gateway resources, including quota exhaustion or cost escalation
  • Potential exposure of sensitive data processed by tools attached to MCP
  • Expansion of an attacker's capabilities within internal automation pipelines that trust LiteLLM-authenticated requests

General mitigation guidance

Mitigation generally involves tightening authentication flows and ensuring that failure states cannot degrade into implicit success.

Pattern-based defensive measures include:

  • Treat all key validation and OAuth2 token checks as fail-closed: if any mandatory credential check fails, the request should be rejected with a clear error rather than passed through.
  • Centralize authentication logic so that there is a single, explicit decision point determining whether a request is authenticated, instead of scattered fallbacks.
  • Avoid constructing "empty" or default auth context objects that can be misinterpreted as valid credentials; require explicit user identity or key association.
  • Separate transport-level Authorization header parsing from internal auth decisions, and ensure passthrough mechanisms do not override gateway access controls.
  • Apply least privilege to MCP tooling and avoid assuming the gateway has already robustly authenticated the caller; tools can implement additional checks or scope limitations.

How teams detect issues like this

Detection involves both code-level and behavior-level strategies:

  • Static analysis and code review: Look for authentication code paths that create default or empty auth objects after failed checks, and for conditional branches where a failure is converted into a permissive state. Pay attention to combined key and OAuth2 validation flows.
  • Policy enforcement: Enforce development policies requiring fail-closed behavior in authentication functions and disallow "best-effort" fallbacks that treat missing or invalid credentials as partial success.
  • Runtime monitoring: Instrument the gateway to log authentication decisions, including reasons for fallback paths; alert on requests that reach MCP tooling without a validated LiteLLM key or associated user context.
  • Security testing: Use automated tests or tooling to send malformed or fabricated Authorization headers to the MCP endpoint and verify that access is consistently denied when credentials are invalid or absent.

Sources

SourceLink
github.comgithub.com/BerriAI/litellm/commit/73869f0faf7d11ee21adcb5f91b8c33a340b6c2c
github.comgithub.com/BerriAI/litellm/pull/26463
github.comgithub.com/BerriAI/litellm/releases/tag/v1.84.0
github.comgithub.com/BerriAI/litellm/security/advisories/GHSA-7488-6r32-c95q
cisa.govcisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-59822
wiz.iowiz.io/blog/ai-infrastructure-honeypot

Frequently asked

questions

Exploitability depends on how widely the MCP Streamable HTTP endpoint is exposed. If it is reachable from the internet or a large internal network, any party with network access can attempt to bypass authentication using crafted Authorization headers.

An attacker only needs network access to the LiteLLM MCP endpoint; no valid LiteLLM key or account is required. The weakness lies in the gateway's handling of the Authorization header and fallback logic, not in user-specific credentials.

The safest approach is to enforce strict, fail-closed authentication logic: do not allow any fallback path to treat failed credential validation as authenticated. All critical MCP tooling access should require a positively validated key or token, and empty or default auth contexts should be treated as unauthenticated.

Prevention involves designing authentication flows with clear, centralized decision points, performing rigorous code review on error-handling and fallback branches, and adding automated tests and static checks focused on auth logic. Treat Authorization headers and third-party OAuth2 integration as untrusted inputs, and ensure that any integration cannot override or weaken the gateway's own access controls.

Find out what's already
exploitable in your codebase.