Vulnerability  ·  2026-11-18

LiteLLM Custom Code Guardrail sandbox escape exploited in the wild to elevate virtual inference keys to admin (CVE-2026-40217)

VulnerabilityHigh impactGlobalCVE-2026-40217
A sandbox escape in LiteLLM's Custom Code Guardrail feature allows an attacker with limited-access LiteLLM "Virtual Keys" to break out of the guardrail sandbox and gain administrative privileges on the LiteLLM proxy. GTIG/Mandiant documented active exploitation: a threat cluster escalated to LiteLLM admin using pre-acquired virtual keys, supporting LLMjacking campaigns that resell stolen model access (one victim billed nearly $1M for 500k+ calls). Reaffirmed in Google's 2026-11-16 GTIG AI Threat Tracker.
LiteLLM is one of the most widely deployed LLM gateways/proxies for routing model traffic and enforcing per-key quotas. A sandbox escape that turns a low-privilege virtual key into an admin account defeats the gateway's authorization boundary and feeds the credential-resale economy, letting attackers mint higher-quota keys and run up bills. This is a concrete AI-infrastructure exploit with confirmed in-the-wild use, not merely a catalogued CVE.
Guarded custom code run inside the LiteLLM guardrail sandbox escapes the sandbox boundary, letting an attacker holding limited virtual keys escalate to admin and mint/expand inference keys
LiteLLM (versions with Custom Code Guardrail sandbox; full fix set bundled in a later 1.x release per GTIG)
Upgrade LiteLLM to a version containing the full CVE-2026-40217 fix set; rotate virtual keys; restrict guardrail code to least-privilege; monitor for unexpected key creation / usage spikes
Google GTIG AI Threat Tracker (2026-11-16)SecurityAffairs on GTIG LiteLLM exploitation
See this in the live feed Explore related AI security and governance findings — updated every morning.
Open the feed →