BerriAI LiteLLM Unprotected Alternate Channel Vulnerability
TL;DR 📌
- BerriAI LiteLLM contains an unprotected alternate channel vulnerability that could allow remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI.
- Highest CVSS: 8.8 (High).
- Listed in CISA KEV (2026-11-18) — this is being exploited in the wild.
- Check the advisory for fixed releases — remediation detail is in the vendor link below.
- CVEs: CVE-2026-40217.
What it is
CVE-2026-40217 is an unprotected alternate channel vulnerability in BerriAI LiteLLM, reachable via the /guardrails/test_custom_code endpoint. The flaw allows remote arbitrary code execution through bytecode rewriting carried out at that URI.
The CVSS vector (AV:N/AC:L/PR:L/UI:N) indicates the endpoint is reachable over the network with low attack complexity, requires low-privilege authentication, and needs no user interaction. Given the impact scores (C:H/I:H/A:H), a successful attack gives full compromise of confidentiality, integrity and availability on the host running LiteLLM.
The naming — “unprotected alternate channel” — points to a code path that bypasses whatever controls normally gate custom guardrail code execution, letting an attacker reach bytecode rewriting logic without going through the intended validation route. This sits in the guardrails testing feature of LiteLLM rather than in core request routing, but the outcome is arbitrary code execution on the server.
This CVE is listed in CISA’s Known Exploited Vulnerabilities catalogue, added on 2026-11-18.
What to do
- Identify any LiteLLM deployment and check its version against the advisory; the NVD entry lists affected builds through 2026-04-08, so anything at or before that point should be treated as exposed until confirmed otherwise.
- No fixed version is listed in the advisory at this time — track the BerriAI LiteLLM advisory page for a patched release and apply it as soon as one is published.
- Restrict network and authentication access to the
/guardrails/test_custom_codeendpoint as an interim mitigation; since PR:L is required, tightening who holds low-privilege credentials or API keys capable of reaching this route reduces exposure. - If custom guardrail code execution isn’t a feature you use, disable it or block the endpoint at the application or reverse-proxy layer until a fix is available.
- Given its presence in the CISA KEV catalogue, prioritise this over other LiteLLM housekeeping and confirm remediation status to leadership promptly.
For leadership 🧭
Executive summary. Any LiteLLM instance running the guardrails testing feature can be fully taken over by an attacker who holds only low-level credentials, with no fix currently available. This is already listed as a known exploited vulnerability, so it needs same-day attention rather than routine patch scheduling.
Why it matters:
- The /guardrails/test_custom_code endpoint allows bytecode rewriting that results in full remote code execution on the host running LiteLLM, not just within the guardrails feature.
- Exploitation only needs low-privilege authentication and no user interaction, so any account or API key with limited access to this route is enough to compromise the server.
- Confidentiality, integrity and availability are all rated high impact, meaning a successful attacker can read data, alter guardrail behaviour, and disrupt the service entirely.
- CISA has added this to its Known Exploited Vulnerabilities catalogue, confirming it is being used against real deployments, not just a theoretical risk.
Now / Next / Later:
- Now: Find every LiteLLM instance in your environment, confirm whether its version predates the 2026-04-08 cutoff, and block or restrict access to the /guardrails/test_custom_code endpoint at the proxy or application layer immediately.
- Next: Review and tighten which accounts or API keys hold low-privilege access capable of reaching the guardrails testing endpoint, and disable the custom guardrail code feature entirely if it isn’t actively used.
- Later: Monitor the BerriAI LiteLLM advisory page for a fixed release, apply it as soon as it ships, and build a standing check into your patch process for LiteLLM’s guardrails and other code-execution-capable testing features.