>_ infosec reads

PoC Watch

LiteLLM remote code execution through the guardrails test endpoint

CVE-2026-40217 · BerriAI LiteLLM proxy · added Nov 24, 2026

Exploited in the wildHigh 8.8

An unprotected alternate channel at the guardrails custom-code test route lets a remote attacker execute code on the proxy. Google Threat Intelligence Group reports it used in LLMjacking: attackers turned limited inference keys into full admin credentials and set up persistence, across finance, retail, transportation and technology firms. CISA added it to KEV on November 18. See the LiteLLM security advisory for the fixed version.

Mitigation by layer

Patch

  • Upgrade LiteLLM to the fixed release named in the project's advisory, in every environment including developer laptops and CI.

Reduce exposure

  • Keep the proxy's admin and management routes off the internet. Until patched, consider blocking the guardrails test route at your reverse proxy.

Harden access

  • Issue scoped virtual keys per team with spend limits, and keep the master key out of application configs.
  • Store upstream provider keys in a secrets manager, not in the proxy's environment file.

Detect

  • Look for requests to the affected route and for abuse of your model spend.
    Step by step
    1. Search reverse proxy or application access logs. Replace the path with your log location.
      grep -F '/guardrails/test_custom_code' <access-log-path>

      Expected output

      No results is the normal case unless your own team tests custom guardrails.
    2. Review provider billing and LiteLLM spend reports for unexplained usage, new keys, or new admin users.

Contain and recover

  • If the proxy was exposed while vulnerable, rotate the master key, every virtual key, and every upstream provider API key, then rebuild the host.

Sources

Compiled from public sources. No exploit code is published here. Verify details against the vendor advisory before acting.

← all entries