high severityConfidence highHistorical record

Attackers are using a LiteLLM guardrail sandbox escape to take over the proxy that holds your AI keys (CVE-2026-40217, CISA KEV)

Direct answer

Attackers are using a LiteLLM guardrail sandbox escape to take over the proxy that holds your AI keys (CVE-2026-40217, CISA KEV), also tracked as CVE-2026-40217 / GHSA-wxxx-gvqv-xp7p / PYSEC-2026-2601 is a high-severity threat campaign HOL Guard tracked from Feb 13, 2026 to Nov 18, 2026, verified against 8 primary sources and last reviewed Nov 18, 2026. Active tracking has ended and the record remains published as a permanent historical research record.

LiteLLM's POST /guardrails/test_custom_code endpoint lets a proxy admin test a custom Python guardrail. In 1.81.8 to 1.83.9 the code ran in a hand-built sandbox that only scanned source text for banned names. X41 D-Sec showed that building those names from string pieces and rewriting a generator's bytecode reaches the real __import__ through a sandbox helper, giving arbitrary command execution in the proxy process. That exposes stored provider API keys, the master key and traffic. A full public exploit has been available since 2026-04-08; BerriAI replaced the sandbox with RestrictedPython in PR #25818 (merged 2026-04-15). GitHub's advisory text says fixed in 1.83.11 while its range and OSV say 1.83.10; HOL compared the PyPI wheels and found the same RestrictedPython sandbox in 1.83.9, 1.83.10 and 1.83.11, so 1.83.11 is the conservative floor. CISA added the CVE to KEV on 2026-11-18 with a 2026-12-02 due date.

Also tracked as CVE-2026-40217 · GHSA-wxxx-gvqv-xp7p · PYSEC-2026-2601 · X41-2026-001

First observed
Feb 13, 2026
Last observed
Nov 18, 2026
Last reviewed
Nov 18, 2026
Tracking ended
Nov 18, 2026

Uncertainty and limitations

Read the evidence limits before acting on this record.

CISA has not published who is exploiting the bug or against whom; ransomware use is listed as unknown. Sources disagree on whether 1.83.10 or 1.83.11 is the first fixed release.

  • LiteLLM 1.81.7 and earlier do not have the vulnerable endpoint.
  • LiteLLM 1.83.11 and later are fixed.
  • Using litellm only as a Python SDK without running the proxy server is not affected.
  • Callers with only team or user virtual keys cannot reach the endpoint; an attacker needs the master key or an admin account.

Guard coverage and policy

What Guard's reviewed assertions do and do not claim for this campaign, and the reviewed starting points for defense.

No Guard coverage mapping or campaign-specific policy guidance is published for this record.

Safe next step. Campaign guidance is defensive context. It does not auto-apply policy or claim universal campaign coverage.

Timeline

Reviewed events, oldest first, each tied to a verified source.

  1. First observed

    X41 D-Sec identifies the guardrail sandbox escape and builds a proof of concept.

    Source:X41 D-Sec advisory X41-2026-001: Guardrail Sandbox Escape in LiteLLM

  2. Disclosure

    Embargo expires; X41 publishes advisory X41-2026-001 with a full working exploit before a patch exists.

    Source:X41 D-Sec advisory X41-2026-001: Guardrail Sandbox Escape in LiteLLM

  3. Vendor action

    BerriAI merges PR #25818 replacing the regex-filtered sandbox with RestrictedPython.

    Source:BerriAI/litellm PR #25818: replace custom_code sandbox with RestrictedPython

  4. Disclosure

    GitHub publishes reviewed advisory GHSA-wxxx-gvqv-xp7p.

    Sources:GitHub advisory GHSA-wxxx-gvqv-xp7p: LiteLLM has a sandbox escape in custom-code guardrail·OSV: GHSA-wxxx-gvqv-xp7p

  5. Update

    CISA adds CVE-2026-40217 to the Known Exploited Vulnerabilities catalog with a 2026-12-02 due date.

    Source:CISA Known Exploited Vulnerabilities catalog

  6. Update

    HOL publishes the operator write-up with version check, log check and workaround.

    Source:HOL blog: LiteLLM CVE-2026-40217 on CISA KEV, how to fix

Publication clock: 5395.8 hours from reviewed disclosure timestamp to HOL publication; 24-hour high target; historical backfill outside target.

Reviewed artifacts

The specific artifacts this record concerns, as reviewed. Names and versions are shown as text; a registry link is not recorded here.

  • litellm@>=1.81.8, <1.83.10 (OSV range); upgrade to 1.83.11 or later per advisory textPyPIpackage

Sources

Every claim on this record is traceable to the sources below.

Related reviewed records

Records this one was reviewed against. Every relationship below is part of a released revision, with the reviewer’s stated reason.

Campaign questions, answered

LiteLLM's POST /guardrails/test_custom_code endpoint lets a proxy admin test a custom Python guardrail. In HOL Guard tracked the campaign from Feb 13, 2026 to Nov 18, 2026.

No. Active tracking ended Nov 18, 2026; this page remains as a labeled historical research record and does not imply the threat is currently active.

The record cites 8 primary sources, names 1 reviewed artifact, and was last fully reviewed Nov 18, 2026 by HOL Guard Security Publishing. Its uncertainty and limitations are stated on the record itself.

Campaign guidance is defensive context. It does not auto-apply policy or claim universal campaign coverage.

The permalink above is permanent. The full record can be downloaded from this page as JSON, an artifact CSV, and a STIX 2.1 bundle, and corrections can be requested through the published correction path on the record. CISA has not published who is exploiting the bug or against whom; ransomware use is listed as unknown. Sources disagree on whether 1.83.10 or 1.83.11 is the first fixed release.

Reviewed in full by HOL Guard Security Publishing.

Published
Last full review
Last modified

Report a correction

Record HGTC-2026-65EEAEF3