BerriAI LiteLLM
LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI.
Affected versions and mitigation
From the CVE record, GitHub Security Advisories and the vendor's references.Affected
- bb0639701796218a3447160e55c0f1097446e4e6085df7dfd39f476d4143743f
- >= 1.81.8, < 1.83.10
Fixed in 1.83.10
from GitHub Security Advisory GHSA-wxxx-gvqv-xp7p
Mitigation
Upgrade litellm to 1.83.10 or later.
Timeline
Days relative to CVE publicationFirst public PoC 39 days after publication; not in CISA KEV. First PoC: learner202649/CVE-2026-40217-PoC (created 19 May 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs · 1 suspicious or fake
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| learner202649/CVE-2026-40217-PoC | 19 May 2026 +39 d | 0 | PoC |
Suspicious or fake 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| HORKimhab/CVE-LiteLLM | 16 Jun 2026 +66 d | 0 | Suspicious · score 50
Why suspicious
|
Only PoCs count toward the first-PoC date and the characteristics below. Suspicious repositories (score ≥ 50) never count. Do not run PoC code from unknown sources.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| nuclei template | nuclei template: LiteLLM < 1.25.0 - Remote Code Execution | 22 Aug 2026 | 14 Nov 2026 |
PoC characteristics
What to hunt for in your logs · from 1 PoC repoPOST /guardrails/test_custom_code
- Key headers
Authorization: Bearer sk-litellm-master-keyAuthorization: Bearer {var}- Content-Type
application/json- Ports
- 4000, 8080
- Seen in
- 1 repo: learner202649/CVE-2026-40217-PoC
- Evidence
- learner202649/CVE-2026-40217-PoC/README.md:56 learner202649/CVE-2026-40217-PoC/exploit/exploit.py:64
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/guardrails/test_custom_code(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET [4000,8080] (msg:"GG PoC-Monitor CVE-2026-40217 BerriAI LiteLLM exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/guardrails/test_custom_code"; http.header; content:"Authorization: Bearer sk-litellm-master-key"; nocase; http.header; content:"Authorization: Bearer "; nocase; reference:url,poc.griffinguard.io/cve/CVE-2026-40217; classtype:web-application-attack; sid:9743971; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: BerriAI LiteLLM exploit attempt (CVE-2026-40217)
id: gg-pocmon-cve-2026-40217-9743971
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-40217. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-40217
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/guardrails/test_custom_code'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.40217