CVE

LiteLLM Guardrails Check (CVE-2026-40217)

Auth-posture check for the LiteLLM proxy: a status-code-only read of the guardrails test endpoint, fixed version cited from X41's advisory, no code sent.

AuthorTrickest
100%

Notes on this workflow

Overview — BerriAI LiteLLM (CWE-420/94): arbitrary code execution via bytecode rewriting at /guardrails/test_custom_code (CISA KEV wording: 'unprotected alternate channel'). CVSS 3.1 8.8. KEV 2026-11-18 (federal due 2026-12-02), exploited in the wild, EPSS 20.2%. Exploitation needs proxy-admin credentials — a stolen/default admin session gets full control of the LLM gateway, its provider API keys and all routed traffic. Fix: per X41 advisory x41-2026-001.

Results — findings.jsonl (one row per target: verdict, endpoint status, auth posture, severity, remediation) + summary.json. unprotected → CRITICAL (upgrade + restart + enforce admin auth + rotate provider API keys), exposed → HIGH (upgrade per x41-2026-001; treat stolen/default admin credentials as full gateway compromise), endpoint_absent → UNKNOWN, not_litellm → INFO, error → ERROR.

Target — bound target list of LiteLLM proxy hosts (default port 4000). Parses host:port/scheme lines into one JSONL row per target; fails closed on zero usable targets and writes out/output.txt for the FILE-port mount.

How it works — GET-only, ≤ 3 requests/host, 1.1 s spacing: GET / (LiteLLM/FastAPI markers), GET /docs if the root is inconclusive, then — only on a confirmed LiteLLM — a deliberately-empty unauthenticated GET of /guardrails/test_custom_code reading ONLY the status code: 401/403 → endpoint present, admin auth enforced (exposed, HIGH); success-class → the 'unprotected alternate channel' condition (unprotected, CRITICAL); 404 → endpoint_absent (verify version against x41-2026-001, never claimed patched). NO code is ever submitted in any form.

Overview

This workflow checks LiteLLM proxies for CVE-2026-40217, the bytecode-rewriting code execution at the /guardrails/test_custom_code endpoint that CISA's KEV entry describes as an unprotected alternate channel. The gateway holds provider API keys and every downstream integration's traffic, which is exactly the compromise the KEV listing describes. Exploitation normally sits behind proxy-admin credentials, which is consistent with the 8.8 score rather than 9.8, so the workflow's real question is authentication posture: is the dangerous endpoint reachable without credentials. The answer comes from status codes only, never a submitted body, because submitting any code to the guardrails endpoint, valid or not, is bytecode execution on the target. A 200-class answer is a CRITICAL configuration finding on its own. The fixed version is cited from advisory x41-2026-001 rather than guessed. Field context: about 1,718 LiteLLM proxies observed on the standard port. Each host comes back with a verdict you can feed into exposure management.

Pipeline

  1. Read the target list and send at most three spaced GETs per host: the proxy root for FastAPI-class fingerprint markers, /docs only when the root was inconclusive, and the guardrails test endpoint only after a confirmed LiteLLM fingerprint.
  2. The endpoint request is deliberately empty and unauthenticated, and only its status code is read: 401 or 403 means the endpoint exists with proxy-admin auth enforced, a 200-class answer means the unprotected alternate channel condition, and a 404 means the endpoint is absent on this build, which is never claimed as patched.
  3. No code is ever submitted, no request body is sent, and no credentials are attempted, because the exploit is a code submission and the admin gate is not this workflow's to test.
  4. Fail closed elsewhere: unreachable hosts are error rows, a 5xx is an error row and the scan stops, and hosts without LiteLLM markers are not_litellm.
  5. Reconcile one verdict per target and write results plus summary counts, with the KEV and advisory citation carried on the summary.

Inputs

  • Target list. LiteLLM proxy addresses, with optional ports, that you are authorized to test. The default file ships a sample host; bind your own.

Outputs

  • results.jsonl. One row per host: target, the fingerprint evidence, the status-code observation, verdict, severity, and the advisory citation.
  • summary.json. One object with the total, verdict counts, the KEV context, and the no-code-submission note.

Integrations

  • HTTP. At most three GETs per host with at least 1.1 seconds of spacing, no bodies, no retries.

Sample output

The records below are illustrative and do not come from a real run. They show a proxy with the guardrails gate enforced, one where the endpoint answers open, and one where the endpoint is absent.

targetportguardrails_statusverdictdetailerror
llm-a.example.com4000401exposedendpoint present, proxy-admin auth enforced; fix per x41-2026-001null
llm-b.example.org4000200unprotectedCRITICAL configuration finding: the alternate channel answers unauthenticatednull
llm-c.example.net4000404endpoint_absentendpoint absent on this build: verify against x41-2026-001, never claim patchednull
{"cve": "CVE-2026-40217", "product": "BerriAI LiteLLM proxy", "total_targets": 3, "verdict_counts": {"exposed": 1, "unprotected": 1, "endpoint_absent": 1}, "kev": true, "kev_added": "2026-11-18", "advisory": "x41-2026-001", "field_context": "about 1,718 proxies observed on port 4000"}

FAQ

Why is a status code enough?

Because the question is authentication posture, and the status code of an unauthenticated GET answers it: 401 or 403 is the gate working, 200 is the unprotected channel, 404 is the endpoint missing. No request body is needed, and a body would be the exploit.

What does a 200-class answer mean?

It means the guardrails test endpoint answers without credentials, which is the condition CISA's KEV wording calls the unprotected alternate channel. The workflow labels it a CRITICAL configuration finding on its own, independent of the version question, because an open code-execution endpoint is a finding before any exploit touches it.

Why is 404 never claimed as patched?

Because an absent endpoint is ambiguous: it can mean a fixed or removed route, or a build that predates the guardrails feature. Neither is verifiable from a status code, so the row stays endpoint_absent with the out-of-band verification step.

What is CVE-2026-40217?

Arbitrary code execution in LiteLLM through bytecode rewriting at the guardrails test endpoint, scored 8.8 by MITRE and the CISA coordinator. KEV-listed 2026-11-18 with exploitation in the wild and EPSS 20.2 percent. The fixed version is cited from advisory x41-2026-001 rather than guessed here.

Get a personalized demo

See Trickest in Action

A 30-minute walkthrough. We map the platform to your stack and answer pricing and deployment questions for your environment.