Skip to content
CVE-2026-40217: LiteLLM guardrail sandbox escape enables code execution, added to CISA KEV

CVE-2026-40217: LiteLLM guardrail sandbox escape enables code execution, added to CISA KEV

First seen 25 Nov 2026, 05:50 UTC • •

Article Content

Browse articles
ThreatCluster AI
ThreatCluster •November 25, 2026 at 05:51 UTC
  • •CVE-2026-40217 allows sandbox escape and arbitrary code execution in LiteLLM via /guardrails/test_custom_code, requiring only low-privilege or authenticated access.
  • •CISA added the flaw to the KEV catalog on 2026-11-18, with federal remediation due 2026-12-02, after Zenity Labs observed abuse.
  • •A public PoC and Nuclei template exist; the exploit is reported to yield root code execution in some deployments.
  • •LiteLLM stores provider API keys, so compromise can expose model credentials; rotate keys on any unpatched exposed instance.
  • •LiteLLM is bundled in Red Hat Ansible Automation Platform 2.6, OpenShift AI 3.3 and Lightspeed Core; apply errata RHSA-2026:24866 and RHSA-2026:30056.

CVE-2026-40217 is a bytecode-rewriting sandbox escape in BerriAI LiteLLM's guardrail "test custom code" feature, reachable via POST /guardrails/test_custom_code, allowing arbitrary code execution in the LiteLLM process (reported running as root in some deployments). The flaw was disclosed on 2026-04-10 and rated CVSS 8.8 (high); Red Hat rates it Important, noting it requires authenticated, administrative-level access to the proxy endpoints. FortiGuard reports the attacker needs only low-privilege access such as a valid API key or low-tier account, which is common in multi-tenant AI gateways. Zenity Labs reportedly observed threat actors abusing the guardrail tester to run code as root, and CISA added the flaw to its Known Exploited Vulnerabilities catalog on 2026-11-18 with remediation due 2026-12-02. A public proof-of-concept appeared on 2026-05-19 and a Nuclei template exists. Because LiteLLM stores and brokers provider API keys, code execution there can expose those keys and the surrounding environment. LiteLLM is also bundled in Red Hat Ansible Automation Platform 2.6, OpenShift AI 3.3 and Lightspeed Core, so exposure may exist without a direct LiteLLM deployment. Red Hat errata RHSA-2026:24866 and RHSA-2026:30056 address the bundled products, and FortiGuard IPS signature 62918 is available. Sources differ on exact fixed-version cut-offs, which should be confirmed against vendor advisories.

Start a free Starter trial for enhanced analysis

Ask AI about this cluster

Timeline

2026-04-10
CVE-2026-40217 published
LiteLLM sandbox escape via bytecode rewriting disclosed; CVSS 8.8.
Red Hat
2026-05-19
First public proof-of-concept
A public PoC for the guardrail sandbox escape became available.
Filestore.Fortinet
2026-11-18
Added to CISA KEV catalog
CISA listed the flaw as actively exploited, with remediation due 2026-12-02, after Zenity Labs observed threat actors abusing the guardrail tester to run code as root.
Filestore.Fortinet

More articles in this cluster (3)

Following this threat?

Track BerriAI and CVE-2026-40217 in your own feed — you're alerted when they show up in new reporting, leak sites or exploitation.

Free account · no card needed

Common questions

Am I affected if I don't run LiteLLM directly?
Possibly: Red Hat Ansible Automation Platform 2.6, OpenShift AI 3.3 and Lightspeed Core bundle LiteLLM, so inventory those products and apply errata RHSA-2026:24866 and RHSA-2026:30056.
How urgent is this?
CISA has listed the flaw in KEV, and a public PoC exists, so FortiGuard recommends emergency patching and restricting the guardrail test endpoint.
What should I do first?
Upgrade LiteLLM to the fixed release (confirm the exact version against vendor advisories), restrict or block /guardrails/test_custom_code, and rotate provider API keys and the master key on any unpatched internet-reachable or multi-tenant instance.