CVE-2026-40217: LiteLLM Remote Code Execution
Active exploitation confirmed in CISA KEV.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HActive exploitation confirmed in the wild. CISA added this to the KEV catalog on 2026-11-18. Federal agencies must patch by 2026-12-02.
CVE-2026-40217 is a high-severity LiteLLM vulnerability that enables remote code execution through the /guardrails/test_custom_code endpoint. CISA added the issue to its Known Exploited Vulnerabilities catalog on November 18, 2026, confirming exploitation in the wild.
TL;DR - CVE-2026-40217 is an authenticated remote-code-execution flaw in BerriAI LiteLLM’s
/guardrails/test_custom_codeendpoint. - LiteLLM versions through April 8, 2026 are affected. - Upgrade to a vendor-verified LiteLLM 1.83.11 or later where applicable. - Restrict or disable the endpoint, investigate historical access, and rotate secrets available to affected processes. - CISA KEV inclusion means exposed deployments require urgent review.
Are You Affected?
CVE-2026-40217 affects BerriAI LiteLLM deployments that expose the guardrail custom-code testing functionality. NVD describes the affected range as LiteLLM versions through 2026-04-08, inclusive. X41 specifically confirmed the ghcr.io/berriai/litellm:main-latest image at digest sha256:bb0639701796218a3447160e55c0f1097446e4e6085df7dfd39f476d4143743f as affected.
| Field | Details |
|---|---|
| CVE ID | CVE-2026-40217 |
| CVSS | 8.8, CVSS 3.1 |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| Attack vector | Network |
| Authentication or privileges | Low privileges required; authenticated HTTP access is described |
| Affected endpoint | /guardrails/test_custom_code |
| Affected product | BerriAI LiteLLM |
| Affected versions | Versions through 2026-04-08, according to NVD |
| Confirmed affected image | ghcr.io/berriai/litellm:main-latest at the X41-listed digest |
| Patch guidance | Use LiteLLM 1.83.11 or later after verifying the release and image digest |
| Active exploitation | Yes, confirmed by CISA KEV inclusion |
Red Hat also tracks the issue in its product security records and errata. If LiteLLM is embedded in, supplied through, or managed as part of a Red Hat product, do not assume that upgrading an upstream package independently resolves the supported-product exposure. Follow the applicable Red Hat advisory and erratum for that deployment.
The key exposure questions are:
- Is the LiteLLM API reachable from an untrusted network?
- Is
/guardrails/test_custom_codeenabled? - Does the endpoint require authentication?
- What privileges does the LiteLLM process have?
- Can the process access cloud credentials, API keys, source code, mounted host files, or sensitive network services?
A deployment behind authentication is not automatically safe. The vulnerability requires low privileges, not necessarily administrative privileges. Treat internet-accessible instances and systems holding sensitive credentials as urgent investigation targets.
Analyst’s Take: CISA KEV inclusion changes the response from routine patching to exposure review and investigation. Start with reachable instances and the privileges available to their LiteLLM processes, then verify the release and image digest before calling remediation complete.
The Fix, If You’re in a Hurry
Upgrade to LiteLLM 1.83.11 or later, subject to confirmation against current BerriAI release information and the image digest you intend to deploy.
Research materials associate remediation with 1.83.10 or later, while other public advisory language identifies 1.83.11 as the safer fixed-version target. Because X41 did not name a confirmed patched version in its advisory, avoid relying on a floating latest or main-latest tag.
For a package-based deployment, record the installed version and upgrade explicitly:
python -m pip show litellm
python -m pip install --upgrade 'litellm>=1.83.11'
python -m pip show litellm
For a container deployment, use a verified fixed image tag or digest supplied through current BerriAI release information:
docker pull ghcr.io/berriai/litellm:<verified-fixed-tag>
docker inspect ghcr.io/berriai/litellm:<verified-fixed-tag> \
--format '{{index .RepoDigests 0}}'
docker stop litellm
docker rm litellm
docker run --name litellm \
--read-only \
--cap-drop=ALL \
ghcr.io/berriai/litellm:<verified-fixed-tag>
The image tag is intentionally a placeholder. Substitute only a release and digest verified through current project or vendor information. Preserve required production configuration, secrets handling, networking, and health checks when rebuilding the service.
Until the upgrade is verified:
- Disable
/guardrails/test_custom_codewhere operationally possible. - Restrict the endpoint to a trusted administrative network.
- Enforce authentication and least privilege.
- Place the service behind an access-controlled reverse proxy or firewall.
- Restrict outbound network access from the LiteLLM process.
- Remove unnecessary host mounts.
- Prevent access to cloud metadata services where feasible.
These controls reduce exposure but do not replace remediation.
For broader incident-preparedness guidance, see our tabletop exercise FAQ.
Temporary Reverse-Proxy Mitigation
A temporary reverse-proxy rule can block the vulnerable path while the upgrade is prepared. For NGINX, a location rule could be structured as follows:
location = /guardrails/test_custom_code {
deny all;
return 403;
}
Test the rule in a staging environment and confirm that no required internal workflow depends on this endpoint. If exploitation is suspected, isolate the instance before rebuilding and rotate every secret available to the process.
How This Vulnerability Works
CVE-2026-40217 affects LiteLLM’s custom-code testing path used by guardrails. The vulnerable endpoint is:
/guardrails/test_custom_code
According to NVD and Red Hat descriptions, a remote attacker can use bytecode rewriting through this endpoint to achieve arbitrary code execution on the affected system.
The issue is associated with:
- CWE-420: Unprotected Alternate Channel
- CWE-94: Improper Control of Generation of Code or Code Injection
In practical terms, a testing or alternate channel intended to process custom guardrail code does not sufficiently constrain attacker-controlled input. An attacker with the required low-level access can submit crafted content that is processed in a way that escapes the intended code-execution restrictions.
The CVSS vector clarifies the operational risk. Exploitation is network-reachable (AV:N), requires low complexity (AC:L), needs low privileges (PR:L), and does not require another user to interact with the request (UI:N). Successful exploitation can affect confidentiality, integrity, and availability at a high level.
The precise exploit implementation and payload format should not be inferred beyond the published descriptions. Defenders should focus on the consequence: attacker-controlled processing at a remotely reachable endpoint can result in code execution under the LiteLLM process identity.
The impact therefore depends heavily on:
- Container isolation
- Service-account permissions
- Mounted volumes
- Network egress
- Accessible secrets
- Cloud permissions
- Host and metadata-service access
Severity, Explained
The NVD and Red Hat-recorded score is 8.8, rated high under CVSS 3.1:
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
| Metric | Value | Operational meaning |
|---|---|---|
| Attack Vector | Network | The attacker can send requests over the network |
| Attack Complexity | Low | No unusual environmental conditions are required |
| Privileges Required | Low | The attacker needs low-level access or authentication |
| User Interaction | None | No separate victim action is required |
| Scope | Unchanged | The vulnerable and impacted security authorities are the same |
| Confidentiality | High | Data accessible to the process may be disclosed |
| Integrity | High | Files, configuration, or services may be modified |
| Availability | High | The service or host environment may be disrupted |
X41 reports a CVSS 4.0 score of 8.7 and characterizes the attack as an authenticated HTTP API request. The difference between the scores reflects scoring-system and metric differences, not a lower operational priority.
CISA’s Known Exploited Vulnerabilities catalog added CVE-2026-40217 on November 18, 2026, with a federal remediation due date of December 2, 2026. CISA lists ransomware campaign use as unknown. That field does not negate the confirmed exploitation status; it means CISA has not attributed the vulnerability’s use to a known ransomware campaign.
Is It Being Exploited?
Yes. Exploitation in the wild is confirmed through CISA KEV inclusion.
CISA’s catalog identifies the vulnerability as the BerriAI LiteLLM Unprotected Alternate Channel Vulnerability. Organizations should treat this as an active incident-response concern, especially where LiteLLM is internet-facing or has access to sensitive credentials.
CISA has not published campaign-specific details in the referenced KEV entry, and ransomware use is listed as unknown. Available research also does not establish a particular threat actor, malware family, or campaign. Do not fill those gaps with assumptions. Investigate local telemetry, preserve evidence, and correlate requests with process and network activity.
A public X41 technical advisory describes the vulnerable endpoint and affected image. However, available research did not verify an authoritative public exploit repository or GitHub proof of concept directly tied to CVE-2026-40217. The absence of a verified public PoC is not a safety signal because the endpoint, attack class, and exploitation status are already known.
Detecting It in Your Environment
Start by inventorying:
- LiteLLM instances
- Package versions
- Container image tags and digests
- Ingress routes
- Authentication controls
- Service-account permissions
- Enabled guardrail features
- Mounted volumes
- Cloud and API credentials
Prioritize deployments that are internet-accessible, expose administrative APIs, enable custom guardrail testing, or run with host mounts and broad cloud permissions.
Search reverse-proxy, API gateway, application, and container logs for:
/guardrails/test_custom_code
A basic Linux search across exported logs might look like:
grep -R --line-number --fixed-strings \
"/guardrails/test_custom_code" \
/var/log/nginx /var/log/apache2 /var/log/litellm 2>/dev/null
For structured logs in Elasticsearch or OpenSearch:
http.request.uri.path:"/guardrails/test_custom_code"
For Splunk:
index=* uri_path="/guardrails/test_custom_code"
| stats count min(_time) as first_seen max(_time) as last_seen
values(src_ip) as source_ips values(user) as users
by host status
These queries identify requests, not confirmed exploitation. Review:
- Source addresses
- Authenticated identities
- Status codes
- Request volume
- User agents
- Request sizes
- Timestamps
- Encoded or serialized payloads
- Activity outside normal administrative windows
- Requests followed by unusual process or network activity
Host and Container Signals
Correlate endpoint access with child-process and network telemetry. A LiteLLM process spawning a shell, interpreter, downloader, or unexpected utility shortly after a request to the vulnerable path is a high-priority signal.
Potentially relevant process names include:
sh
bash
python
perl
curl
wget
Legitimate deployments may use some of these tools, so investigate them in context rather than treating any single process as proof of compromise.
Example Linux audit rule for monitoring process execution by a known LiteLLM service account:
auditctl -a always,exit -F arch=b64 -S execve \
-F auid>=1000 -F auid!=4294967295 \
-k litellm-process-exec
Also inspect for:
- Unexpected outbound connections from the LiteLLM container or host
- Access to cloud metadata endpoints
- Newly created files in
/tmp, application directories, or mounted volumes - Modified startup scripts and configuration
- Container launches or privilege changes
- Reads of environment files, credential stores, and service-account tokens
If compromise is suspected, isolate the affected service, preserve logs and container or filesystem artifacts, and rotate secrets accessible to the LiteLLM process. Rebuild from a verified fixed release rather than trusting the existing container or host state.
Response Checklist
Use this sequence for an exposed or potentially affected deployment:
- Identify affected assets. Locate LiteLLM packages, containers, image digests, public endpoints, and service accounts.
- Restrict the vulnerable endpoint. Disable
/guardrails/test_custom_codeor block it at the reverse proxy and firewall. - Preserve evidence. Export access, application, authentication, process, DNS, and network logs before making destructive changes.
- Investigate historical access. Search for endpoint requests and correlate them with process creation, file changes, and outbound connections.
- Rotate secrets. Replace API keys, cloud credentials, tokens, and other secrets accessible to the LiteLLM process.
- Upgrade explicitly. Deploy LiteLLM 1.83.11 or later after verifying the release and image digest.
- Rebuild when appropriate. If compromise is suspected, use a clean, verified image or host rather than upgrading in place.
- Confirm remediation. Verify the running package version, image digest, endpoint behavior, network controls, and service-account permissions.
- Document the decision. Record affected systems, evidence reviewed, remediation versions, and remaining exposure.
References and Further Reading
- NVD: CVE-2026-40217
- X41 D-Sec: LiteLLM advisory
- Red Hat CVE record
- Red Hat erratum RHSA-2026:24866
- Red Hat erratum RHSA-2026:30056
- Red Hat Bugzilla 2457301
- BerriAI LiteLLM on GitHub
Organizations should identify exposed LiteLLM instances, block or restrict /guardrails/test_custom_code, review historical access, rotate potentially exposed credentials, and upgrade to a verified fixed release. Active exploitation is confirmed, so an exposed vulnerable instance warrants investigation even when application logs show only a small number of requests.
This article may contain affiliate links. We earn a commission on qualifying purchases at no extra cost to you.