CVE-2026-40217: BerriAI LiteLLM · Remote code execution
Exploitation: In the wild · CVSS 8.8 High · Authenticated · Published 2026-04-10
Description
LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI.
Enclave's analysis
LiteLLM's guardrail test-code endpoint lets a caller submit Python that runs in a weak, regex-based sandbox; a published bypass rewrites bytecode to reach __import__ and get full code execution, usually as root since the official Docker image runs as root by default. It normally needs an admin-level API key, but two other LiteLLM auth bugs let a low-privilege user self-escalate to admin first, removing that gate. A public, verified working exploit exists and honeypots already caught real attack attempts matching it. Patch to 1.83.14 or later, or at minimum block the guardrail endpoints and stop running the proxy as root.
Fix
Upgrade LiteLLM (BerriAI) to 1.83.10/1.83.11 closes the playground-only path; 1.83.14 (2026-04-25) closes the production-path variant and the chained privilege-escalation route; Red Hat Ansible Automation Platform 2.6 (lightspeed-chatbot image) to RHSA-2026:24866; Red Hat OpenShift AI 3.3 (odh-llama-stack-core image) to RHSA-2026:30056. No fixed version is listed for LiteLLM, Red Hat Lightspeed Core (lightspeed-stack); follow the vendor advisory.
Affected versions
| Product | Vulnerable | Fixed in |
|---|---|---|
| LiteLLM | bb0639701796218a3447160e55c0f1097446e4e6085df7dfd39f476d4143743f | Not listed |
| LiteLLM (BerriAI) | >=1.81.8, <1.83.10 per GHSA; NVD expresses this as 'through 2026-04-08' (date-based CPE match, a coarser framing) | 1.83.10/1.83.11 closes the playground-only path; 1.83.14 (2026-04-25) closes the production-path variant and the chained privilege-escalation route |
| Red Hat Ansible Automation Platform 2.6 (lightspeed-chatbot image) | rpm builds before 1780102732 | RHSA-2026:24866 |
| Red Hat OpenShift AI 3.3 (odh-llama-stack-core image) | rpm builds before 1782310008 | RHSA-2026:30056 |
| Red Hat Lightspeed Core (lightspeed-stack) | Listed as affected with no version boundary published; confirm against vendor advisory before treating as patched | Not listed |