CVE-2026-136539 in LiteLLM
Summary
by MITRE • 11/24/2026
LiteLLM Pass-Through Endpoint Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of LiteLLM. Authentication is required to exploit this vulnerability.
The specific flaw exists within the handling of pass_through_endpoints. The issue results from the lack of proper validation of code before it is executed via module import. An attacker can leverage this vulnerability to execute code in the context of the service account. Was ZDI-CAN-31433.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/24/2026
The identified vulnerability represents a critical security flaw within LiteLLM, specifically affecting its pass-through endpoint functionality. This issue stems from an improper validation mechanism when handling user-supplied input intended for module imports. In software architecture, particularly in frameworks that allow dynamic configuration or extension via code injection points, the integrity of imported modules is paramount. The vulnerability arises because the application fails to rigorously sanitize or validate the identifiers used during the import process before execution. This lack of strict validation allows an authenticated attacker to inject malicious Python module names or paths that are subsequently executed by the underlying runtime environment. Because LiteLLM operates as a service, often running with elevated privileges necessary for database access and network communication, successful exploitation results in arbitrary code execution within the context of the service account rather than under restricted user permissions.
From a technical perspective, this flaw is classified as CWE-94 Improper Control of Generation of Code (Code Injection). The root cause lies in the unsafe use of dynamic import functions where input derived from external sources is directly incorporated into the code generation or execution logic without adequate sanitization. In Python environments, constructs such as _import_ or similar dynamic loading mechanisms are powerful but dangerous if not strictly controlled. When an attacker provides a crafted string that resolves to a malicious module containing executable payload code, the application imports and executes this code automatically. This bypasses standard security controls because the execution is initiated by trusted system processes acting on behalf of the service account. The requirement for authentication means that while remote unauthenticated exploitation is not possible, any compromised user credentials or insider threats with access to these endpoints can trigger full system compromise.
The operational impact of this vulnerability is severe, leading directly to Remote Code Execution (RCE). An attacker who successfully exploits this flaw gains the ability to run arbitrary commands on the host machine where LiteLLM is deployed. This level of control allows for comprehensive data exfiltration, modification or destruction of stored data, and further lateral movement within the internal network infrastructure. Since LLM orchestration layers often connect to sensitive backend systems including vector databases, credential stores, and proprietary model endpoints, compromising this service provides a strategic foothold for attackers. The attacker can establish persistent backdoors, install cryptominers, or use the compromised server as a pivot point to attack other assets that are not directly exposed to the internet but are accessible from the internal network segment hosting LiteLLM.
This vulnerability aligns with MITRE ATT&CK techniques related to Command and Scripting Interpreter abuse, specifically T1059 which covers execution of scripts or commands via system APIs. The exploitation path involves leveraging valid credentials to access a specific API endpoint, injecting malicious input into the pass-through configuration, and triggering automatic code execution through module import mechanisms. Defense in depth strategies are essential here since authentication alone is insufficient protection against this class of injection flaws. Organizations must treat any interface that accepts dynamic code identifiers as high-risk and apply strict allow-listing principles rather than relying on blacklist-based filtering which can be easily bypassed using encoding techniques or alternative syntax variations supported by the interpreter.
Mitigation strategies should focus primarily on input validation and architectural hardening. The most effective immediate remediation is to implement a strict allow-list of permitted module names for pass-through endpoints, ensuring that only explicitly approved libraries can be imported dynamically. If dynamic imports are not strictly necessary for business operations, disabling this feature entirely reduces the attack surface significantly. Additionally, running LiteLLM with least-privilege principles ensures that even if code execution occurs, the impact is contained within a restricted environment without access to sensitive files or network resources. Regular security audits of third-party libraries and framework configurations are also recommended to identify similar patterns in other components where dynamic evaluation or import mechanisms might be present but inadequately secured against injection attacks.