Skip to content

Red Hat — CVE-2026-40217

access.redhat.com • November 25, 2026

A flaw was found in LiteLLM. A remote attacker can exploit this flaw by performing bytecode rewriting at the /guardrails/test_custom_code URI. This could lead to arbitrary code execution, allowing the attacker to run malicious code on the affected system.

This vulnerability is rated as having an Important impact because successful exploitation permits an authenticated remote attacker to escape the sandbox and achieve arbitrary code execution in the context of the service process. In Red Hat environments where LiteLLM is integrated into AI tooling, access to proxy administration endpoints requires administrative credentials and is typically not exposed to unauthenticated users. Although the severity of process compromise is high, the requirement for administrative privileges prevents this flaw from reaching Critical impact.

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

Bugzilla 2457301 : LiteLLM: LiteLLM: Arbitrary Code Execution via bytecode rewriting

CWE-94 : Improper Control of Generation of Code

Common Vulnerability Scoring System (CVSS) Score Details

Info alert: Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications ).

CVSS v3 Score Breakdown

Red Hat: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

cve.org: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Understanding the Weakness (CWE)

Technical Impact: Bypass Protection Mechanism

In some cases, injectable code controls authentication; this may lead to a remote vulnerability.

Technical Impact: Gain Privileges or Assume Identity

Injected code can access resources that the attacker is directly prevented from accessing.

Integrity,Confidentiality,Availability

Technical Impact: Execute Unauthorized Code or Commands

When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. As a result, code injection can often result in the execution of arbitrary code. Code injection attacks can also lead to loss of data integrity in nearly all cases, since the control-plane data injected is always incidental to data recall or writing.

Technical Impact: Hide Activities

Often the actions performed by injected control code are unlogged.

Frequently Asked Questions

"Under investigation" doesn't necessarily mean that the product is affected by this vulnerability. It only means that our Analysis Team is still working on determining whether the product is affected and how it is affected.

The term "Affected" means that our Analysis team has determined that this product, such as Red Hat Enterprise Linux 8 or OpenShift Container Platform 4, is affected by this vulnerability and a fix may be released to address this issue in the near future. This includes all minor releases of this product unless noted otherwise in the Statement text.

Upgrade to a supported product version that includes a fix for this vulnerability (recommended).

Apply a mitigation (if one exists).

Customers with the Technical Account Manager (TAM) RHEL Security Select Add-on can review this CVE directly with their TAM.

Apply a mitigation, if one exists.

Customers with the technical account manager (TAM) RHEL Security Select Add-on can review this CVE directly with their TAM.

Not sure what something means? Check out our Security Glossary .

For clarification or corrections, please Red Hat Product Security .

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

CVE-2026-40217: LiteLLM guardrail sandbox escape enables code execution, added to CISA KEV 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. 1 sources 79

Extracted Entities

Attack Types (1)

Companies (1)

CWE Weaknesses (1)

Domains (1)

Tools (1)