/

CVE-2026-35030

Severity:

CRITICAL RISK

(9.1)

Improper Authentication in LiteLLM JWT/OIDC Gateway

CVE-2026-35030

Modified

Vulnerability type

Category:

Improper Authentication

CWE:

CWE-287, CWE-222

Impact:

Authentication Bypass and Privilege Escalation

Severity:

CRITICAL RISK

(9.1)

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

LiteLLM's JWT/OIDC authentication layer previously used only the first 20 characters of a token as the cache key for OIDC userinfo responses.

An unauthenticated attacker who can send crafted JWT-like tokens to an instance with JWT authentication enabled can deliberately collide with a victim's cached entry and inherit that user's identity and permissions.

Affected context

This vulnerability affects LiteLLM deployments that:

  • Enable JWT/OIDC authentication (enable_jwt_auth: true)
  • Use OIDC userinfo responses that are cached per token
  • Accept tokens over a network-accessible LiteLLM endpoint

The weakness appears when different tokens can share the same cache key because only a prefix of the token string (the first 20 characters) is used to index cached userinfo data.

Exploit preconditions

  • Attack surface: Public or internal LiteLLM HTTP endpoints that accept JWT/OIDC tokens.
  • Required access: Ability to submit arbitrary tokens to the LiteLLM instance (no prior authentication required).
  • Trigger point: Sending a crafted token whose first 20 characters match those of a legitimate user's token, causing a cache hit in the userinfo cache.
  • Why exploitation is possible: The cache key is derived from a truncated token prefix (token[:20]), so different tokens produced with the same header structure and algorithm can share identical leading characters, allowing deliberate cache collisions.

Why this happens

The core issue is an improper authentication mechanism where the identity cache is keyed by an insufficiently unique token prefix instead of a full, unambiguous identifier.

By using token[:20] for the OIDC userinfo cache key, LiteLLM conflates multiple possible tokens into the same logical identity, violating the expectation that each token maps to exactly one authenticated principal.

This maps to CWE-287: Improper Authentication, as the system relies on a weak token-derived signal for identity binding and authorization decisions, allowing attackers to masquerade as other users without possessing their actual credentials.

Potential impact

  • An attacker may impersonate another authenticated user whose token is cached.
  • The attacker could gain access to that user's API keys, model access, or LLM routing permissions exposed through LiteLLM.
  • The attacker may escalate privileges if the victim account has elevated roles or administrative capabilities.
  • Unauthorized requests could be made on behalf of the victim, including data exfiltration or model misuse.
  • Audit trails and logs can be polluted with actions falsely attributed to the legitimate user.

General mitigation guidance

Effective mitigation aims to ensure that cached identity data cannot be shared between distinct tokens and that identity is bound to strong, unambiguous keys.

General defensive patterns include:

  • Deriving cache keys from the entire token or from stable, unique identifiers such as the token's signature, jti claim, or a combination of issuer (iss) and subject (sub).
  • Avoiding use of short prefixes, truncated values, or non-unique portions of tokens for any security decision or cache indexing.
  • Applying a strict separation between authentication artifacts (tokens) and caching identifiers, ensuring caches do not weaken the underlying authentication guarantees.
  • Enforcing conservative cache TTLs for userinfo and revocation-aware designs so that stale or hijacked cache entries have limited impact.
  • Designing the gateway to treat failed userinfo lookups or ambiguous cache states as authentication failures rather than best-effort fallbacks.

How teams detect issues like this

Detection focuses on surfacing unsafe identity caching patterns and anomalous authentication behavior:

  • Code-level review: Look for uses of token substrings (e.g., token[:N]) as cache keys, map keys, or identifiers in authentication and authorization flows.
  • Static analysis rules: Configure linters or custom static checks to flag truncated tokens, non-unique identifiers, and token-based caching in auth code paths.
  • Logging and monitoring: Instrument authentication middleware to log token identifiers (safely hashed, not raw tokens) and associated principals, then detect cases where different client IPs, user agents, or sessions are mapped to the same cached identity in suspicious patterns.
  • Policy enforcement: Introduce CI/CD checks that prevent changes which derive authentication decisions from partial tokens, predictable IDs, or non-cryptographic identifiers.
  • Runtime anomaly detection: Use behavioral analytics to flag accounts that appear to authenticate from multiple unrelated contexts in a pattern consistent with cache impersonation.

Sources

SourceLink
github.comgithub.com/BerriAI/litellm/security/advisories/GHSA-jjhc-v7c2-5hh6
access.redhat.comaccess.redhat.com/errata/RHSA-2026:13545
access.redhat.comaccess.redhat.com/errata/RHSA-2026:28960
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30056
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-35030
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2455509
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-35030.json

Frequently asked

questions

Yes, it can be remotely exploitable in deployments where LiteLLM's JWT/OIDC endpoints are exposed over the network and enable_jwt_auth is turned on. An attacker only needs the ability to send crafted tokens to the affected gateway.

The attacker needs no prior authenticated access. They must be able to interact with the LiteLLM instance and submit arbitrary tokens. They do not need knowledge of the victim's full token, only the ability to craft a token that collides on the truncated prefix.

The safest pattern is to ensure that authentication and userinfo caches are keyed by a unique, stable, and untruncated identifier tied to the token or user, such as the full token hash or a canonical claim set. Avoid using token prefixes or any ambiguous identifiers in security-critical caches.

Treat caching as part of the security boundary for authentication logic. Establish coding standards that forbid truncated tokens or weak identifiers in auth-related caches, incorporate security reviews for any changes to authentication flows, and use automated checks to flag non-unique keys or lossy transformations in identity management code.

Find out what's already
exploitable in your codebase.