Red Hat — CVE-2026-40217
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 .
