Skip to content
Security Alerts

CVE-2026-40217: Code Execution via Guardrail Testing in LiteLLM (KEV)

The code filter of the LiteLLM guardrail testing endpoint can be bypassed with Python bytecode manipulation, giving command execution on the proxy server. CISA confirms active exploitation...

Summary

ParameterValue
CVE IDCVE-2026-40217
Alert SourceCISA KEV - Active Exploitation
CVE Publication Year2026
Date Published2026-11-18
VendorBerriAI
ProductLiteLLM (proxy / AI gateway); also shipped in Red Hat products
Vulnerability Typecode injection (CWE-94), guardrail sandbox escape
CVSS Score8.8 (high)
EPSS Score17.0% (percentile: 97%)
CISA KEVYes - confirmed active exploitation
RansomwareNot confirmed
Remediation Deadline2026-12-02

Vulnerability Description

Source: NVD, CISA KEV, X41 D-Sec (X41-2026-001)

LiteLLM is an open-source proxy that exposes a single OpenAI-compatible API to more than a hundred LLM providers (load balancing, cost tracking, rate limiting, guardrails). The /guardrails/test_custom_code endpoint lets an authenticated user submit custom Python code to test a guardrail. The server tries to block dangerous operations with a regex-based filter, but the filter works on source code only.

X41 D-Sec researchers showed that the filter can be bypassed by assembling blocked attribute names from string fragments and rewriting CPython bytecode. The attacker then runs arbitrary commands with the privileges of the LiteLLM process — root in the default Docker image. Exploitation requires low-privileged authentication (CVSS vector PR:L), such as a proxy API key.

According to NVD, LiteLLM versions from 1.81.8 up to (but not including) 1.83.10 are affected. The component also ships in Red Hat products — NVD lists Ansible Automation Platform, OpenShift AI and OpenShift Lightspeed, and Red Hat has released errata for them. CISA added the vulnerability to the KEV catalog on 18 November 2026, which means active exploitation has been confirmed.

Required Actions

  1. Update LiteLLM to version 1.83.10 or later (affected range according to NVD: 1.81.8 up to, but not including, 1.83.10).
  2. If you use Red Hat Ansible Automation Platform, OpenShift AI or OpenShift Lightspeed, apply the Red Hat errata for CVE-2026-40217 (including RHSA-2026:24866 and RHSA-2026:30056).
  3. Until you update, block the /guardrails/test_custom_code path on the reverse proxy and restrict access to the LiteLLM API to trusted networks.
  4. Review issued proxy API keys and revoke unnecessary ones — any authenticated user can exploit the flaw.
  5. If the proxy was reachable from the internet, treat it as a possible incident: review requests to the guardrail endpoint, processes and outbound connections from the container, and rotate LLM provider keys stored in the configuration.

CISA set a remediation deadline of 2 December 2026 for US federal agencies.

Who Is Affected?

Organizations running LiteLLM (BerriAI) as a gateway to language models — standalone, in a container or as part of AI platforms — and users of Red Hat products that include LiteLLM (Ansible Automation Platform, OpenShift AI, OpenShift Lightspeed). Also check development and data science environments, where LiteLLM is often deployed outside the central IT inventory.

Sources


Need help securing your systems? nFlo team offers vulnerability management and 24/7 SOC services. Contact us.

Learn More

Share:

Talk to an expert

Have questions about this topic? Get in touch with our specialist.

Sales Representative
Grzegorz Gnych

Grzegorz Gnych

Sales Representative

Response within 24 hours
Expert consultation
Individual approach

Providing your phone number will speed up contact.

Want to Reduce IT Risk and Costs?

Book a consultation - we respond within 24h

Response in 24h Custom quote No obligations