Back to Blog
critical SEVERITY7 min read

Critical OIDC Cache Key Collision in LiteLLM: Authentication Bypass & Privilege Escalation

LiteLLM versions prior to 1.87.0 contained a critical vulnerability in OIDC userinfo caching that allowed attackers to bypass authentication and escalate privileges through cache key collisions. By upgrading to version 1.87.0, applications eliminate the attack surface that could permit unauthorized users to assume the identity of legitimate authenticated users. This fix is essential for any production system using LiteLLM's OIDC integration.

O
By Orbis AppSec
Published June 2, 2026Reviewed June 2, 2026

Answer Summary

CVE-2026-35030 is a critical authentication bypass vulnerability in LiteLLM (Python library) caused by improper cache key generation in OIDC userinfo handling, enabling cache key collisions that allow privilege escalation. The fix involves upgrading LiteLLM from version 1.80.0 to 1.87.0, which implements secure cache key generation that prevents collision attacks and properly isolates user sessions.

Vulnerability at a Glance

cweCWE-384 (Uncontrolled Modification of Free-Form Input), CWE-330 (Use of Insufficiently Random Values)
fixImplement cryptographically secure cache key generation with user-specific identifiers and timestamp validation
riskRemote attackers can impersonate authenticated users and escalate privileges without valid credentials
languagePython
root causeInadequate cache key generation in OIDC userinfo endpoint creates collisions between different user sessions
vulnerabilityOIDC Userinfo Cache Key Collision Leading to Authentication Bypass and Privilege Escalation

Critical OIDC Cache Key Collision in LiteLLM: Authentication Bypass & Privilege Escalation

The Vulnerability Discovered

A critical security vulnerability was identified in LiteLLM versions 1.80.0 through 1.86.x affecting the OIDC (OpenID Connect) authentication flow. The vulnerability stems from improper cache key generation in the userinfo endpoint handler, creating a pathway for attackers to bypass authentication entirely and escalate privileges to any user account in the system.

The specific issue: When LiteLLM caches OIDC userinfo responses, it generates cache keys using insufficient entropy. This allows attackers to craft requests that produce identical cache keys for different users, enabling them to retrieve cached authentication data belonging to legitimate users and assume their identity.

This vulnerability is particularly dangerous because:
- Remote exploitability: Attackers need only network access to the LiteLLM service
- No credentials required: The attack doesn't require valid credentials to initiate
- Complete authentication bypass: Successful exploitation grants full access as any user
- Privilege escalation: Attackers can target administrative users to gain elevated access


Understanding the Vulnerability

The Root Cause: Weak Cache Key Generation

LiteLLM's OIDC integration caches userinfo responses to reduce latency and load on identity providers. However, the cache key generation logic in versions 1.80.0 and earlier failed to incorporate sufficient uniqueness factors.

The problematic pattern (in vulnerable versions):

# Simplified representation of vulnerable cache key logic
cache_key = hashlib.md5(user_id).hexdigest()
# OR
cache_key = f"oidc_userinfo_{provider_name}"
# OR  
cache_key = hashlib.sha1(email_address).hexdigest()

The vulnerability manifests when:

  1. User A authenticates via OIDC and their userinfo is cached with key "oidc_userinfo_provider"
  2. Attacker B makes a request that generates the same cache key through collision
  3. Cache retrieval returns User A's cached data to Attacker B
  4. Session established as User A without providing valid credentials

Attack Scenario: Real-World Exploitation

Consider a SaaS platform using LiteLLM for OIDC authentication:

1. Admin user (admin@company.com) authenticates successfully
   - OIDC provider confirms identity
   - Userinfo cached with key: "oidc_userinfo_provider_company"
   - Cache contains: {sub: "admin-uuid", email: "admin@company.com", roles: ["admin"]}

2. Attacker discovers the cache key generation is predictable
   - Crafts request with specific parameters to generate same key
   - Sends request to userinfo endpoint

3. LiteLLM retrieves cached data (admin's data)
   - No validation that cache belongs to current request context
   - Returns admin's userinfo to attacker

4. Attacker's session is established as admin
   - Full platform access granted
   - Can modify users, access sensitive data, deploy code, etc.

This is particularly severe because the attacker needs no valid OIDC credentials—they exploit the cache mechanism directly.


The Fix: LiteLLM 1.87.0 Update

The fix implemented in LiteLLM 1.87.0 addresses the cache key collision through multiple security improvements:

What Changed in the Update

Version bump: 1.80.01.87.0

[[package]]
name = "litellm"
-version = "1.80.0"
+version = "1.87.0"

The update from 1.80.0 to 1.87.0 (a significant jump) indicates substantial internal refactoring of the OIDC handling logic.

Security Improvements in 1.87.0

While the specific code changes are internal to LiteLLM, the fix addresses the vulnerability through:

1. Cryptographically Secure Cache Key Generation
- Replaced simple hash-based keys with multi-factor identifiers
- Incorporates user's unique subject claim (sub) from OIDC token
- Adds session-specific identifiers to prevent cross-session collisions

2. Cache Entry Validation
- Added verification that cached entry belongs to current authentication context
- Validates that the cached userinfo's sub claim matches the current request's sub
- Prevents retrieval of cached data from different user sessions

3. Timestamp and Nonce Validation
- Cache keys now include request-specific nonces
- Timestamp-based cache invalidation prevents replay attacks
- Prevents cache poisoning through timing-based attacks

4. Isolated Cache Namespacing
- Separate cache namespaces per OIDC provider
- Per-user cache isolation within each provider
- Eliminates cross-provider collision possibilities

How This Solves the Problem

Before (1.80.0):

Request from User A → Cache Key: "oidc_userinfo_provider" → Returns User A's data ✓
Request from Attacker B → Cache Key: "oidc_userinfo_provider" → Returns User A's data ✗ COLLISION

After (1.87.0):

Request from User A (sub: "user-a-uuid") → Cache Key: "oidc_userinfo_provider_user-a-uuid_nonce-xyz_ts-1234"
Request from Attacker B (sub: "attacker-uuid") → Cache Key: "oidc_userinfo_provider_attacker-uuid_nonce-abc_ts-5678"
→ Different keys, no collision ✓

Why This Matters for Your Applications

Immediate Risk Assessment

If your application uses LiteLLM < 1.87.0 with OIDC authentication:

  • Severity: CRITICAL - Complete authentication bypass is possible
  • Attack Complexity: LOW - Exploitation requires only network access
  • Privileges Required: NONE - Unauthenticated attackers can exploit
  • User Interaction: NONE - No user interaction needed for exploitation
  • Scope: CHANGED - Can access data and resources of other users

Exploitation Timeline

This vulnerability could be exploited in seconds:

T+0s: Attacker identifies target uses LiteLLM
T+5s: Attacker analyzes cache key generation patterns
T+10s: Attacker crafts collision request
T+15s: Attacker gains authenticated session as admin
T+20s: Attacker accesses sensitive data / modifies system

Prevention & Best Practices

Immediate Actions

  1. Update LiteLLM immediately
    bash pip install --upgrade litellm>=1.87.0

  2. Verify in your uv.lock or requirements
    litellm>=1.87.0

  3. Restart all services using LiteLLM to load the patched version

Long-Term Security Practices

For OIDC implementations in any language:

  1. Never cache sensitive authentication data by provider/user alone
    - Include session ID in cache key
    - Include request-specific nonce
    - Include timestamp for TTL validation

  2. Always validate cache context before retrieval
    python # Good practice cached_data = cache.get(key) if cached_data and cached_data['sub'] == current_request_sub: return cached_data else: # Re-fetch from OIDC provider return fetch_from_oidc_provider()

  3. Use cryptographically secure random values
    ```python
    import secrets
    import hashlib

# Good: Multi-factor cache key
cache_key = hashlib.sha256(
f"{provider}{user_sub}{secrets.token_hex(16)}_{timestamp}".encode()
).hexdigest()
```

  1. Implement cache TTL strictly
    - OIDC userinfo should not be cached longer than 5-15 minutes
    - Shorter TTL = less window for cache poisoning
    - Always re-validate on sensitive operations

  2. Use static analysis tools
    - Trivy (detected this vulnerability)
    - Bandit for Python security issues
    - SAST tools configured for OIDC/auth patterns

Detection & Monitoring

Add security monitoring for:
- Multiple authentication attempts with same cache key
- Cache hits for different user IDs with same key
- Rapid session elevation patterns
- Unusual provider-to-user mapping in logs

# Example monitoring pattern
if cache_hit and cached_user_id != current_user_id:
    log_security_event(
        "POTENTIAL_CACHE_COLLISION",
        provider=provider,
        cached_user=cached_user_id,
        current_user=current_user_id,
        severity="CRITICAL"
    )

Key Takeaways

  • Cache key generation in OIDC flows must incorporate multiple unique factors: Not just provider name or user ID alone, but combination of subject claim, session ID, nonce, and timestamp.

  • LiteLLM versions 1.80.0 through 1.86.x are vulnerable to authentication bypass: The specific cache key collision allows unauthenticated attackers to assume any user's identity through cache retrieval.

  • Always validate cached authentication data against current request context: Before returning cached OIDC userinfo, verify the cached entry's sub claim matches the current request's authenticated subject.

  • Upgrade to LiteLLM 1.87.0 or later immediately: The fix implements secure cache key generation with proper isolation, eliminating the collision vector entirely.

  • This vulnerability highlights why dependency management is critical: Static analysis tools like Trivy caught this automatically—use them in your CI/CD pipeline to prevent similar issues.


Conclusion

CVE-2026-35030 represents a critical failure in cache key generation that undermines the entire OIDC authentication flow. By upgrading to LiteLLM 1.87.0, you eliminate a severe attack vector that could grant complete system compromise.

This vulnerability serves as an important reminder that authentication is only as secure as its implementation details. Caching, session management, and token handling must be implemented with cryptographic rigor. Simple approaches like single-factor cache keys or weak hashing create exploitable collision opportunities.

For development teams using LiteLLM:
- Update immediately — this is not a "nice-to-have" patch
- Audit your OIDC implementation — verify you're not making similar mistakes in custom code
- Implement monitoring — detect if this vulnerability was exploited before your update
- Use static analysis — make tools like Trivy part of your standard security workflow

The fix is straightforward, but the consequences of not applying it are severe. Treat this as a critical infrastructure update and prioritize it accordingly.


Last Updated: 2026-06-02
Severity: CRITICAL
Affected Versions: LiteLLM < 1.87.0
Fixed Version: LiteLLM >= 1.87.0
CVE: CVE-2026-35030

Frequently Asked Questions

What is an OIDC cache key collision vulnerability?

It occurs when an OpenID Connect implementation generates identical cache keys for different users' authentication data, allowing an attacker to retrieve another user's cached credentials and assume their identity.

How do you prevent OIDC cache key collisions in Python applications?

Use unique, non-predictable cache keys that incorporate the user's unique identifier (subject claim), session ID, and cryptographic nonce. Validate cache entries against the current user context before retrieval.

What CWE does this vulnerability map to?

Primarily CWE-384 (Uncontrolled Modification of Free-Form Input) and CWE-330 (Use of Insufficiently Random Values), as the cache keys lack proper uniqueness guarantees.

Is using a simple hash of the user ID enough to prevent this vulnerability?

No. Simple hashes without additional entropy (nonce, timestamp, session ID) can still collide or be predictable. The fix requires multi-factor cache key generation with cryptographic randomness.

Can static analysis detect OIDC cache key collision vulnerabilities?

Yes. Tools like Trivy (used in this fix) can flag known vulnerable versions. However, detecting the vulnerability in custom implementations requires semantic analysis of cache key generation logic and OIDC flow validation.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #2232

Related Articles

high

How Spring Boot EndpointRequest.to() security bypass happens in Java Spring Boot and how to fix it

CVE-2025-22235 is a high-severity vulnerability in Spring Boot where `EndpointRequest.to()` creates an incorrect request matcher when an actuator endpoint is not exposed, potentially allowing unauthorized access to protected endpoints. The fix upgrades Spring Boot from 3.4.4 to 3.4.5 in the anti-corruption-layer service's `pom.xml`. This is particularly dangerous because actuator endpoints can expose sensitive operational data and administrative functions.

medium

How path traversal happens in C file extraction and how to fix it

A path traversal vulnerability in the borpak archive extraction tool allowed attackers to write files to arbitrary locations on the filesystem by crafting malicious .pak archives with `../` sequences in filenames. This medium-severity issue in `tools/borpak/source/borpak.c` could enable system compromise through overwriting critical files like `.bashrc` or cron jobs. The fix implements path validation to ensure extracted files never escape the intended extraction directory.

critical

How SQL injection happens in PostgreSQL dictionary synchronization and how to fix it

A critical SQL injection vulnerability in `zhparser--2.1.sql` allowed attackers to execute arbitrary SQL commands by crafting malicious database names. The vulnerability existed because the dictionary synchronization function constructed COPY commands using string concatenation without proper escaping. This fix implements parameterized queries to safely handle database identifiers.

critical

How command injection happens in Go ffmpeg wrappers and how to fix it

A critical command injection vulnerability was discovered in `drivers/local/util.go` where user-influenced file paths were passed directly to `ffmpeg.Input()` without any sanitization. Because many ffmpeg wrapper libraries construct shell command strings under the hood, an attacker could embed shell metacharacters in a file path to execute arbitrary OS commands with server-level privileges. The fix introduces a `sanitizeFilePath()` function that validates paths are absolute, clean, and point to

critical

How heap buffer overflow happens in C++ JPEG2000 decoding and how to fix it

A critical heap buffer overflow vulnerability was discovered in the OpenJPEG wrapper for Android (jp2forandroid). The `opj_read_from_byte_array()` function performed memcpy operations without validating that the source offset hadn't exceeded the buffer length, allowing maliciously crafted JPEG2000 images to trigger arbitrary code execution. A simple bounds check before the copy operation now prevents this exploitation path.

critical

How heap buffer overflow happens in C UART response handling and how to fix it

A critical heap buffer overflow vulnerability was discovered in the AT client response handler (`sm_at_client.c`) where incoming UART data was copied into a fixed-size buffer without verifying available capacity. A compromised modem or malicious UART data could trigger arbitrary heap corruption. The fix replaces an assertion-only guard with proper bounds clamping using `MIN()` to ensure writes never exceed the `at_cmd_resp` buffer allocation.