/

CVE-2026-136539

Severity:

HIGH RISK

(7.2)

Code Injection (CWE-94) in LiteLLM Pass-Through Endpoint

CVE-2026-136539

Received

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.2)

CVSS version:

3.0

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A code injection vulnerability in LiteLLM's pass-through endpoint handling can allow an authenticated attacker to execute arbitrary code. The risk arises when input is not properly validated before it is executed through module import.

Affected context

The issue occurs in LiteLLM's handling of pass-through endpoints, where code is executed via module import without adequate validation. Exploitation requires authentication and may affect deployments where an attacker can reach the relevant endpoint and provide input that reaches this code path.

Exploit preconditions

  • Attack surface: LiteLLM pass-through endpoint handling
  • Required access: Authentication to the affected service
  • Trigger point: Processing input through the vulnerable endpoint path
  • Why exploitation is possible: Code is not adequately validated before execution via module import

Why this happens

The underlying flaw is improper control over code generation or execution, mapped to CWE-94: Improper Control of Generation of Code. The application allows input to influence code executed through module import without sufficient validation or restrictions.

Potential impact

  • An authenticated attacker could execute arbitrary code in the context of the LiteLLM service account.
  • The attacker may be able to access data or resources available to that account.
  • Depending on the service account's permissions and deployment boundaries, compromise could affect connected systems or services.

General mitigation guidance

Defensive approaches focus on preventing untrusted input from influencing executable code.

  • Prefer fixed, explicit module mappings over dynamically importing modules based on request-controlled values.
  • Validate inputs against strict allowlists and reject values outside the expected schema.
  • Separate data handling from code execution and avoid evaluating or importing request-derived content.
  • Limit the service account's permissions and restrict its access to sensitive resources.
  • Reduce exposure of authenticated endpoints and apply authorization checks appropriate to the operation.

How teams detect issues like this

  • Use static analysis to identify dynamic imports or execution paths influenced by request data.
  • Review pass-through endpoint code for validation performed only after import or execution.
  • Check whether module names, paths, or other import parameters can be derived from user-controlled input.
  • Apply code-review and CI policies that flag dynamic execution and require documented validation and authorization.

Sources

SourceLink
github.comgithub.com/BerriAI/litellm/pull/27801
zerodayinitiative.comzerodayinitiative.com/advisories/ZDI-26-1084/

Frequently asked

questions

The issue affects a service endpoint and can be exploited remotely, but authentication is required.

An attacker needs authenticated access to the affected LiteLLM service and must be able to reach the vulnerable pass-through endpoint path.

Avoid deriving imports or executable behavior from request-controlled input. Use explicit allowlists and validate input before any import or execution occurs.

Keep data separate from executable logic, review dynamic import paths, enforce authorization, and run the service with least privilege.

Find out what's already
exploitable in your codebase.