/

CVE-2026-12773

Severity:

HIGH RISK

(7.3)

Improper Authentication (CWE-287) in litellm MCP Proxy

CVE-2026-12773

Modified

Vulnerability type

Category:

Improper Authentication

CWE:

CWE-287, CWE-303

Impact:

Authentication Bypass

Severity:

HIGH RISK

(7.3)

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

An improper authentication flaw in the litellm MCP Proxy's UserAPIKeyAuth function can allow attackers to bypass intended access controls when using user API keys.

When exposed remotely, this weakness may let unauthorized clients interact with MCP proxy functionality as if they were authenticated users.

Affected context

This issue arises in deployments of BerriAI litellm (up to 1.59.8) that use the MCP Proxy component and rely on the _experimental UserAPIKeyAuth mechanism for authenticating requests.

The vulnerability is relevant when:

  • MCP Proxy endpoints are exposed over a network
  • User API keys are used for client authentication
  • The experimental authentication module is enabled or integrated into production-like workflows

Under these conditions, the authentication layer may not reliably distinguish legitimate users from unauthorized clients.

Exploit preconditions

  • Attack surface: Network-exposed MCP Proxy endpoints using UserAPIKeyAuth
  • Required access: Ability to send crafted requests to the proxy (no prior authenticated session necessarily required)
  • Trigger point: Invocation of the UserAPIKeyAuth function in user_api_key_auth_mcp.py during request handling
  • Why exploitation is possible: The authentication logic performs insufficient or incorrect verification of provided API keys and/or associated user identity, allowing an attacker to be treated as authenticated under certain conditions

Why this happens

The root cause aligns with CWE-287: Improper Authentication.

The UserAPIKeyAuth function in the MCP Proxy's experimental authentication module does not robustly verify client credentials or fails to bind the presented API key correctly to a specific user identity or authorization context.

This may include accepting malformed or partially valid tokens, relying on weak comparison logic, or skipping critical checks based on configuration or error conditions, leading to incorrect assumptions about the caller's authenticity.

Potential impact

  • Unauthorized access to MCP Proxy endpoints that should require valid user authentication
  • Ability for attackers to invoke backend AI or MCP services as if they were legitimate users
  • Exposure or misuse of data accessible through the proxy, depending on downstream integrations
  • Abuse of compute or AI service quotas, leading to operational or financial impact
  • Potential pivot into broader application environments that trust MCP Proxy authentication decisions

General mitigation guidance

Mitigation typically focuses on strengthening authentication logic and reducing trust in experimental components.

Common defensive patterns include:

  • Enforcing strict, constant-time verification of API keys with clear binding to user identities and scopes
  • Centralizing authentication logic rather than duplicating ad hoc checks in experimental modules
  • Introducing defense-in-depth through additional authorization checks at downstream services, not solely at the proxy
  • Applying least-privilege principles so that authenticated sessions only gain narrowly scoped access
  • Segregating experimental or beta authentication features from production traffic until thoroughly reviewed and tested

How teams detect issues like this

Detection efforts can focus on both code and runtime behavior:

  • Static analysis: Flag custom authentication routines that diverge from standard, vetted patterns or bypass centralized auth middleware
  • Code review: Look for experimental modules handling API keys, weak comparisons, missing error handling, and any paths that accept requests without strong credential checks
  • Policy enforcement: Require security review for new authentication mechanisms and enforce use of shared security libraries or frameworks
  • Runtime monitoring: Log and analyze authentication attempts, especially anomalies such as successful access without expected credentials or unusual patterns of API key usage

Automated code review and application security testing tools can assist in spotting improper authentication patterns early in the development lifecycle.

Sources

SourceLink
gist.github.comgist.github.com/YLChen-007/3cfaad10a69d7a15e4d4d458cb53309e
vuldb.comvuldb.com/cve/CVE-2026-12773
vuldb.comvuldb.com/submit/811282
vuldb.comvuldb.com/vuln/372515
vuldb.comvuldb.com/vuln/372515/cti
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-12773
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2491112
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-12773.json

Frequently asked

questions

Yes. When the MCP Proxy is exposed over the network and uses the vulnerable UserAPIKeyAuth mechanism, attackers can attempt authentication bypass remotely by sending crafted requests.

The attacker generally needs only network access to the MCP Proxy endpoint; they do not necessarily need a valid account or prior authenticated session if the improper authentication logic can be triggered anonymously.

The most robust approach is to route all authentication through well-tested, centralized mechanisms that strictly verify API keys and bind them to user identities and permissions, removing or hardening any experimental authentication code paths.

Use standardized authentication frameworks, mandate security reviews for new auth flows, avoid deploying experimental modules into production without thorough validation, and enforce defense-in-depth so downstream services do not solely trust a single proxy's authentication decision.

Find out what's already
exploitable in your codebase.