# CVE-2026-40217: LiteLLM - RCE

> Live exploitation tracking for CVE-2026-40217 by the CrowdSec Live Exploit Tracker, built from real-world attack data crowdsourced from CrowdSec's global network.

Page: https://tracker.crowdsec.net/cves/CVE-2026-40217

## Key facts

- **Exploitation phase:** Limited Exploitation. The vulnerability is known but shows very limited attacker interest or exploitation activity.
- **CVSS score:** 8.8
- **Public exploit available:** Yes
- **Affected products:** BerriAI LiteLLM
- **Weaknesses:** CWE-420 (Unprotected Alternate Channel)
- **Tags:** ai_mcp

## Description

LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI.

## CrowdSec analysis

[CVE-2026-40217](https://euvd.enisa.europa.eu/vulnerability/CVE-2026-40217) is a high-severity remote code execution vulnerability in BerriAI LiteLLM, affecting versions through 2026-04-08. An attacker with low-level privileges can exploit bytecode rewriting at the `/guardrails/test_custom_code` endpoint to execute arbitrary code, potentially compromising the confidentiality, integrity, and availability of the affected system.

CrowdSec has been tracking this vulnerability and its exploits since 19th of November 2026.

CrowdSec has not observed any significant exploitation activity targeting CVE-2026-40217 across its network. As a result, no community-driven trend analysis is available for this vulnerability at this time.

Attackers target the `POST /guardrails/test_custom_code` endpoint with a crafted JSON `custom_code` Python payload to escape the guardrail sandbox and execute commands. Exploitation attempts may include a bearer token in the `Authorization` header.

## Timeline

- 2026-04-10: CVE Published. CVE-2026-40217 is published to NVD.
- 2026-11-18: CISA KEV. CVE-2026-40217 is added to the Known Exploited Vulnerabilities catalog by CISA.
- 2026-11-19: Rule Released. CrowdSec releases a rule to detect CVE-2026-40217 exploitation attempts against the CrowdSec Network.
- 2026-11-26: CrowdSec First Seen. CrowdSec observes in-the-wild exploitation of CVE-2026-40217 for the first time.
- 2026-12-02: CISA Remediation Deadline. Expiration of the CISA remediation deadline as described in [BOD 22-01](https://www.cisa.gov/news-events/directives/bod-22-01-reducing-significant-risk-known-exploited-vulnerabilities).

## References

- https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm/
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2026/CVE-2026-40217.yaml

## Live exploitation data

The [Live Exploit Tracker page](https://tracker.crowdsec.net/cves/CVE-2026-40217) follows observed exploitation activity for CVE-2026-40217. [Request an API key](https://tracker.crowdsec.net/request-api-key) for full access to its exploitation timeline, attacking IP addresses and blocklists.
