On November 18, 2026, CISA added CVE-2026-40217, a code-execution flaw in the LiteLLM proxy, to the Known Exploited Vulnerabilities catalog. LiteLLM is the open-source gateway a lot of teams put in front of OpenAI, Anthropic, Azure OpenAI, Bedrock and Vertex so applications get one API and one set of virtual keys. That design concentrates every upstream provider credential in one process. Treating this as a routine patch misses the point: if the gateway was compromised before you upgraded, the attacker already has keys that work without it, and upgrading LiteLLM doesn't revoke them.

This post covers what the advisory and threat reporting actually say, how to find LiteLLM in your environment, and detections at three layers: the gateway's own HTTP routes, the gateway host, and the cloud AI services whose keys it holds.

IR Runbook Bundle · $49 · Buy Once
Production runbooks for phishing, ransomware, credential compromise, and insider threat
Copy-pasteable queries, escalation matrices, communication templates. Instant download, keep forever.
Get IR Bundle — $49 →

What the sources say

The primary record is the LiteLLM advisory, GHSA-wxxx-gvqv-xp7p, mirrored in the GitLab advisory database:

The exploitation context comes from Google Threat Intelligence Group and Mandiant's November 2 LLMjacking report. It describes a follow-on cluster that received pre-validated LiteLLM virtual keys from an initial-access actor and escalated them to PROXY_ADMIN master credentials. The same report describes LLMjacking incidents with fraudulent consumption over $100,000 in a single day and cumulative charges reaching $1 million at some organizations before access was revoked. Those figures are for LLMjacking broadly, not this CVE alone.

The sources don't fully agree

Google's report describes CVE-2026-40217 as a user ID rebind issue in the /key/regenerate endpoint used to escalate to PROXY_ADMIN. The advisory, CISA and the original researchers describe it as the guardrail sandbox escape. The CSA note suggests Google grouped several steps of an escalation chain under one ID; that's CSA's inference, not confirmed. For detection the difference doesn't matter much: watch both the key and user management routes and the guardrail routes, because a low-privilege virtual key that becomes admin is the path to the code-execution bug.

That second point is why the "requires admin" language shouldn't make you relax. The advisory's admin requirement and the CVSS vector's low-privilege rating already disagree, and the Google report shows an actor obtaining ordinary virtual keys and turning them into admin. If anyone outside the platform team holds a virtual key, assume the admin boundary can be crossed.

Step one: find every LiteLLM instance

AI gateways are often deployed by application or data science teams, not platform engineering, so your CMDB is probably incomplete. Check in this order:

Record for each instance: version, whether the admin UI and management routes are reachable from outside the platform team's network, who holds virtual keys, and which provider credentials the gateway holds. The last list is your rotation scope if anything below fires.

Detection 1: The routes that matter in proxy access logs

LiteLLM normally sits behind nginx, an ingress controller or a cloud load balancer. Normal application traffic hits the inference routes (/chat/completions, /v1/..., /embeddings). The routes below are administrative and should be rare and predictable. This search assumes access logs with CIM-style fields (uri_path, method, status, clientip), as produced by the standard access_combined extractions; adjust the index and sourcetype to yours.

Splunk SPL — LiteLLM admin and guardrail routes in reverse proxy logs
index=web sourcetype IN ("access_combined", "nginx:plus:access") earliest=-30d
    (uri_path="/guardrails*" OR uri_path="/key/*" OR uri_path="/user/*"
     OR uri_path="/config/update" OR uri_path="/model/new")
| eval route=case(
    like(uri_path, "/guardrails/test_custom_code%"), "guardrail_code_test",
    like(uri_path, "/guardrails%") AND method IN ("POST", "PUT"), "guardrail_write",
    like(uri_path, "/key/%"), "key_management",
    like(uri_path, "/user/%"), "user_management",
    true(), "config_or_model_change")
| stats count min(_time) as first_seen max(_time) as last_seen values(status) as statuses
    values(uri_path) as paths by clientip route
| convert ctime(first_seen) ctime(last_seen)
| sort route - count

Any guardrail_code_test hit you can't tie to a platform engineer testing a guardrail is an incident: normal traffic never touches it. guardrail_write is the persistent version, since custom-code guardrails saved through POST /guardrails or PUT /guardrails/{id} run on future requests. Key and user management traffic is normal from your admin tooling, so the useful question is who, which the next search answers.

Request bodies aren't in standard access logs. If you need to see whether a key update set broad allowed_routes or a user update changed user_role, you'll need the LiteLLM database itself or request logging at the gateway. Plan for that before an incident, not during.

Detection 2: New sources calling management routes

The escalation path in Google's report starts with a valid, low-privilege virtual key. The traffic looks authenticated and well formed. What gives it away is the source: a client that has only ever called inference routes, or has never been seen before, starting to call key, user or guardrail routes.

Splunk SPL — First-seen sources on LiteLLM management routes, 30-day baseline
index=web sourcetype IN ("access_combined", "nginx:plus:access") earliest=-31d
    (uri_path="/guardrails*" OR uri_path="/key/*" OR uri_path="/user/*" OR uri_path="/config/update" OR uri_path="/model/new")
| stats min(_time) as first_seen max(_time) as last_seen count values(uri_path) as paths by clientip
| where first_seen >= relative_time(now(), "-1d")
| convert ctime(first_seen) ctime(last_seen)
| sort - count

Run it daily. Expect noise when admins work from new networks or a new CI runner gets an IP; keep a lookup of known admin sources and filter them out. If clients sit behind a load balancer that rewrites the source, use the X-Forwarded-For field instead of clientip, or you'll baseline the load balancer.

Detection 3: The gateway process spawning things it shouldn't

Successful exploitation means attacker Python running inside the proxy process. From there the next steps are predictable: read the environment, dump the database connection string, pull more tooling. If the host or node has Defender for Endpoint on Linux, a LiteLLM process spawning a shell or a download tool is high-confidence. Confirm how your deployment launches LiteLLM (the litellm CLI, or uvicorn/gunicorn with LiteLLM's app) and adjust the match.

Sentinel KQL — Shells and download tools spawned by the LiteLLM proxy process
let lookback = 30d;
DeviceProcessEvents
| where TimeGenerated > ago(lookback)
| where InitiatingProcessCommandLine has "litellm"
    or InitiatingProcessParentFileName has "litellm"
| where FileName in~ ("sh", "bash", "dash", "ash", "zsh", "curl", "wget", "nc", "ncat", "socat",
    "python", "python3", "perl", "base64", "env", "printenv", "cat", "psql", "pg_dump")
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName,
    InitiatingProcessCommandLine, FileName, ProcessCommandLine, FolderPath
| order by TimeGenerated desc

Some deployments run health checks, startup scripts or database migrations through a shell or helper processes when the container starts. Baseline those in the first week by command line, then alert on anything else. env, printenv or cat against /proc/self/environ or a config file from a running proxy is worth an immediate look: that's where the master key, database URL and provider keys live.

Detection 4: New outbound destinations from the gateway

A gateway talks to a fixed set of model provider endpoints, its database and maybe a logging service. A new destination is either a newly configured model, or something sending data out. Configured models with an attacker-controlled api_base are one of the persistence mechanisms the CSA note calls out, and they look exactly like this.

Sentinel KQL — Outbound destinations from LiteLLM not seen in the previous 14 days
let baselineStart = ago(15d);
let baselineEnd = ago(1d);
let litellmNet = DeviceNetworkEvents
    | where TimeGenerated > baselineStart
    | where InitiatingProcessCommandLine has "litellm"
    | where RemoteIPType == "Public"
    | extend Dest = iff(isnotempty(RemoteUrl), RemoteUrl, RemoteIP);
let baseline = litellmNet
    | where TimeGenerated < baselineEnd
    | distinct DeviceName, Dest;
litellmNet
| where TimeGenerated >= baselineEnd
| join kind=leftanti baseline on DeviceName, Dest
| summarize Connections = count(), FirstSeen = min(TimeGenerated), Ports = make_set(RemotePort, 5)
    by DeviceName, Dest, RemoteIP
| order by FirstSeen asc

Provider endpoints behind CDNs rotate IPs, which is why the query prefers RemoteUrl when it's populated. Where it isn't, you'll see new IPs for known providers; resolve and allowlist them rather than dropping IP-only rows, since direct-to-IP connections are exactly what exfiltration tooling tends to use.

Detection 5: Your provider keys being used without the gateway

This is the detection that still works after the attacker has left the gateway. A stolen provider credential is used from the attacker's infrastructure, so the identity is the gateway's but the source isn't. For Bedrock, that shows up in CloudTrail. Google's report lists the runtime calls (InvokeModel, InvokeModelWithResponseStream, Converse), model-access changes, and invocation-logging changes as the events to watch.

Sentinel KQL — Bedrock use by the gateway's identity from outside its egress IPs, plus logging and access changes
let lookback = 7d;
let gatewayPrincipals = dynamic(["arn:aws:iam::111122223333:role/litellm-gateway"]); // your gateway identities
let gatewayEgress = dynamic(["203.0.113.10", "203.0.113.11"]);                      // your gateway NAT IPs
let inference = dynamic(["InvokeModel", "InvokeModelWithResponseStream", "Converse", "ConverseStream"]);
let control = dynamic(["PutModelInvocationLoggingConfiguration", "DeleteModelInvocationLoggingConfiguration",
    "PutUseCaseForModelAccess", "CreateFoundationModelAgreement"]);
AWSCloudTrail
| where TimeGenerated > ago(lookback)
| where EventSource == "bedrock.amazonaws.com"
| where (EventName in (inference) and UserIdentityArn has_any (gatewayPrincipals) and SourceIpAddress !in (gatewayEgress))
    or EventName in (control)
| summarize Calls = count(), Errors = countif(isnotempty(ErrorCode)), Regions = make_set(AWSRegion, 10),
    Agents = make_set(UserAgent, 5), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
    by UserIdentityArn, SourceIpAddress, EventName
| order by FirstSeen asc

Role sessions show up with an assumed-role ARN, so match on the role name with has_any as above rather than exact equality. The control arm fires on any principal: invocation logging changes and model-access agreements should come from your infrastructure-as-code pipeline, and Google's report flags logging being disabled by a non-IaC principal as high severity. A burst of Errors across many regions is the validation sweep pattern Google describes, where the actor tests which models and regions a key can reach.

For Azure OpenAI, the key itself is used against the data plane, which only appears if diagnostic logging is enabled on the resource. The control plane is logged regardless, and key listing is how an attacker with stolen Azure credentials gets a fresh API key:

Sentinel KQL — Azure AI / OpenAI key access, deployment changes and diagnostic setting tampering
let lookback = 14d;
AzureActivity
| where TimeGenerated > ago(lookback)
| where OperationNameValue in~ (
    "MICROSOFT.COGNITIVESERVICES/ACCOUNTS/LISTKEYS/ACTION",
    "MICROSOFT.COGNITIVESERVICES/ACCOUNTS/REGENERATEKEY/ACTION",
    "MICROSOFT.COGNITIVESERVICES/ACCOUNTS/DEPLOYMENTS/WRITE",
    "MICROSOFT.INSIGHTS/DIAGNOSTICSETTINGS/DELETE")
| where ActivityStatusValue in~ ("Success", "Succeeded")
| summarize Count = count(), Resources = make_set(_ResourceId, 10), FirstSeen = min(TimeGenerated)
    by Caller, CallerIpAddress, OperationNameValue
| order by FirstSeen asc

Your deployment pipeline and the gateway's own managed identity will show up here legitimately. Allowlist those callers, and anything left over (especially a user account listing keys from an unfamiliar IP, or a new model deployment nobody requested) is worth a ticket. A deleted diagnostic setting on a Cognitive Services account is worth one on its own.

If you find something: response order

  1. Contain the gateway. Block external access to the admin and management routes at the proxy or ingress. If you can't patch immediately, deny POST /guardrails/test_custom_code at the reverse proxy; CSA and other write-ups recommend this as an interim control. Snapshot the container or host and the LiteLLM database before changing anything.
  2. Rotate everything the gateway held, upstream first. Every provider API key, cloud IAM credential and managed identity secret the gateway used, then the LiteLLM master key, the database password, and all virtual keys. Rotating virtual keys alone does nothing about the provider keys the attacker already copied.
  3. Check the gateway's stored configuration for persistence. Upgrading doesn't remove what an attacker saved in the proxy database. Look for proxy_admin users you don't recognize, custom-code guardrails your team didn't write, callbacks you didn't configure, and model entries whose api_base points somewhere unfamiliar.
  4. Check the bill. Pull per-model usage and cost for every provider account the gateway touched for the exposure window. Unexpected models, regions or volume are evidence of key use outside the gateway, and the providers' fraud teams will want the timeline.
  5. Upgrade. The advisory lists 1.83.10 as fixed. The CSA note recommends 1.83.14-stable or later as a baseline because it also contains fixes for the related privilege-escalation issues. Pin to a specific version tag rather than a floating tag like latest.

Hardening AI gateways

AI gateways have become one of the highest-value secrets stores in the environment, and most SOCs aren't watching them like one. CVE-2026-40217 will be patched within a few weeks at most organizations; the provider keys copied before that won't expire on their own. Find every gateway, look at who has been calling its admin routes, and watch your model providers' logs for your own credentials coming from someone else's infrastructure. That last detection keeps paying off long after this CVE is old news.

Weekly Intelligence Pack
Production detections like these, every Tuesday

Every issue includes a full detection rule for Sentinel, CrowdStrike or Splunk, with investigation steps, false positive guidance and MITRE mapping. Platforms rotate so you get broad coverage over time.

Join — $14.99/mo See a Sample Issue
Founding member pricing locked for life · 30-day money back