News · DiggingBeagle record

LiteLLM custom guardrails exposed a sandbox-escape route, not its earlier virtual-key escalation

CVE-2026-40217 concerns execution of custom Python guardrail code inside an insufficiently restricted context. The separate real-world LLMjacking privilege flaw has a different endpoint, prerequisite and remedy.

Published
Nov 20, 2026

The report

A gateway administrator may need to test a custom guardrail before applying it to model traffic. That creates a hazardous boundary when user-supplied Python is described as restricted but can reach objects or bytecode capabilities outside the intended sandbox. The LiteLLM advisory documents that class of escape in the custom-code guardrail pathway.

Two LiteLLM reports, two different rights

This vulnerability centers on the execution context of a custom guardrail and the ability of an eligible caller to submit code for it. It is not equivalent to the previously reported virtual-key ownership bug through /key/regenerate, which could change privilege relationships for an ordinary key. Treating both as the same exploit would blur which roles can reach the vulnerable endpoint and which deployments need the relevant fix.

The advisory associates this path with CVE-2026-40217 and describes affected releases and mitigation. An operator must check the specific proxy version, whether the custom-code testing endpoint is exposed and what authentication it requires. The published mechanism alone does not show that any arbitrary public model request becomes root code execution.

At a design level, a language-level guardrail sandbox cannot be assumed equivalent to isolation enforced by the operating system. Testing untrusted user-defined code is a distinct trust decision from evaluating a user prompt, even when both activities occur inside an AI gateway.

Research behind this