Threat reportVulnerabilityTL-2026-0738
CVE-2026-42271: LiteLLM MCP Server Command Injection Under Active Exploitation, Chained with CVE-2026-48710 (Starlette BadHost) for Unauthenticated RCE
CVE-2026-42271 is an OS command injection flaw in the LiteLLM (BerriAI) AI gateway MCP test endpoints (POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list) that lets an authenticated proxy user spawn arbitrary commands on the proxy host. CISA added it to the Known Exploited Vulnerabilities catalog on June 8, 2026.
Key facts
| Identifiers | TL-2026-0738, CVE-2026-42271, CVE-2026-48710 |
|---|---|
| Also known as | BadHost, LiteLLM MCP RCE |
| Severity | CRITICAL |
| CVSS | 8.8 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) |
| Exploitation status | Linked CVE exploited in the wild; Listed in CISA KEV: CVE-2026-42271 (added ), CVE-2026-48710 (added ) |
| EPSS | CVE-2026-42271: 92.5% (99.8th percentile); CVE-2026-48710: 7.0% (94.0th percentile) |
| Affected products | BerriAI LiteLLM; Encode / Kludex Starlette |
| Weaknesses (CWE) | CWE-77, CWE-78, CWE-444, CWE-1289 |
| MITRE ATT&CK techniques | T1005 Data from Local System, T1033 System Owner/User Discovery, T1036 Masquerading, T1041 Exfiltration Over C2 Channel, T1053.003 Scheduled Task/Job: Cron, T1059 Command and Scripting Interpreter, T1059.004 Unix Shell, T1059.006 Python, T1068 Exploitation for Privilege Escalation, T1082 System Information Discovery, T1083 File and Directory Discovery, T1098.004 Account Manipulation: SSH Authorized Keys and 14 more in the attack flow |
| Motivation | FINANCIAL |
| Target sectors | technology, artificial-intelligence, software, cloud-services, government |
| Target regions | Global, North America, Europe |
| Detection rules | 9 (1 shown free) |
| Sources | 15 cited sources |
Detection coverage
As of 2026-11-16, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-0738 across Splunk SPL, Microsoft KQL and Sigma, covering 41 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: LiteLLM Host Credential Theft — Proxy .env Read & IMDS / Outbound Exfil — C2 & Lateral Movement (CVE-2026-42271)
Detects post-exploitation credential theft and C2/exfil from a compromised LiteLLM gateway: a child of the LiteLLM process reading the proxy .env/config holding provider API keys and LITELLM_MASTER_KEY (T1552.001/T1005/T1528), or the proxy host reaching the cloud instance metadata service 169.254.169.254 to steal instance-role credentials (T1552.005), or making anomalous outbound connections used to exfiltrate the stolen secrets (T1041/T1567).
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1552.001, T1552.005, T1528, T1005, T1041, T1567
- Data sources: sysmon, edr, firewall, auditd, netflow
- Severity: critical
- Confidence: high
Splunk SPL
(index=edr sourcetype="sysmon:process" parent_command_line="*litellm*" (target_filename="*.env*" OR command_line="*.env*" OR command_line="*credentials*"))
OR (index=netfw sourcetype="sysmon:network" parent_command_line="*litellm*" (dest_ip="169.254.169.254" OR (dest_ip!="10.0.0.0/8" AND dest_ip!="172.16.0.0/12" AND dest_ip!="192.168.0.0/16")))
| eval imds=if(dest_ip="169.254.169.254",1,0)
| eval secret_read=if(match(coalesce(target_filename,command_line),"(?i)(\.env|credentials|api[_-]?key|master[_-]?key)"),1,0)
| where imds=1 OR secret_read=1
| stats count, values(dest_ip) as dest_ips, values(target_filename) as files, values(command_line) as cmds by host, parent_process_name
| sort - countMicrosoft KQL
let window = 24h;
let imds = "169.254.169.254";
union
( DeviceNetworkEvents
| where Timestamp > ago(window)
| where InitiatingProcessCommandLine has "litellm" or InitiatingProcessParentFileName has "python"
| where RemoteIP == imds or (RemoteIPType == "Public")
| extend Signal = iff(RemoteIP == imds, "IMDS_credential_theft", "anomalous_egress")
| project Timestamp, DeviceName, Signal, RemoteIP, RemoteUrl, InitiatingProcessFileName, InitiatingProcessCommandLine ),
( DeviceFileEvents
| where Timestamp > ago(window)
| where InitiatingProcessParentCommandLine has "litellm"
| where FileName endswith ".env" or FileName has "credentials"
| extend Signal = "proxy_secret_read"
| project Timestamp, DeviceName, Signal, RemoteIP = "", RemoteUrl = FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine )
| summarize Hits = count(), Signals = make_set(Signal, 10), Targets = make_set(RemoteUrl, 20) by DeviceName
| order by Hits descSigma
title: LiteLLM Host Credential Theft via Proxy .env Read and Cloud IMDS Access
id: c4e7f9a2-3b8d-4c61-9f0e-2a7d5b1c3d03
status: experimental
description: Detects post-exploitation credential theft following CVE-2026-42271 RCE — a child of the LiteLLM proxy reading the provider-key .env, or the host reaching the cloud instance metadata endpoint 169.254.169.254 to steal instance-role credentials for lateral movement into connected AI infrastructure.
references:
- https://horizon3.ai/attack-research/vulnerabilities/cve-2026-42271-chained-with-cve-2026-48710/
- https://attack.mitre.org/techniques/T1552/005/
author: Threadlinqs Team
date: 2026/06/09
tags:
- attack.credential_access
- attack.t1552.001
- attack.t1552.005
- attack.t1528
- attack.collection
- attack.t1005
- cve.2026.42271
logsource:
product: linux
category: network_connection
detection:
selection_imds:
Image|contains: 'litellm'
DestinationIp: '169.254.169.254'
condition: selection_imds
falsepositives:
- Legitimate cloud SDK calls to IMDS for instance role refresh (should originate from the runtime, not a shell child of litellm)
- Backup or secret-management agents reading the .env on a defined schedule
level: criticalKnown false positives:
- Legitimate cloud SDK refreshing instance-role credentials from IMDS (originates from the runtime, not a shell child of litellm)
- Backup or secret-management agents reading the proxy .env on a defined schedule
Tuning notes: Confirm the proxy host's normal IMDS access pattern — legitimate role refreshes come from the application runtime, not a child shell. Tighten the egress branch to your known-good destinations and exclude approved exfil-lookalikes (telemetry, package mirrors). Correlate with SPL-002 (shell spawn) to attribute the read/egress to the injected subprocess.
- BadHost Host-Header Auth-Bypass to LiteLLM MCP Endpoints — Exploitation (CVE-2026-48710) · unlock with TL Creds
- LiteLLM Proxy Subprocess Reading Provider Secrets — Post-Exploitation (CVE-2026-42271) · unlock with TL Creds
- LiteLLM Host Reaching Cloud IMDS for Instance-Role Credential Theft — Credential Access (CVE-2026-42271) · unlock with TL Creds
- Non-Admin / Unauthenticated Success on LiteLLM MCP Test Endpoints — Exploitation (CVE-2026-42271) · unlock with TL Creds
- LiteLLM Python Proxy Spawning Interpreter/LOLBin Child — Post-Exploitation (CVE-2026-42271) · unlock with TL Creds
- Vulnerable LiteLLM / Starlette Exposed on Gateway Port 4000 — Exposure & Lateral-Movement Surface (CVE-2026-42271 / CVE-2026-48710) · unlock with TL Creds
- LiteLLM MCP Test-Endpoint Command Injection w/ BadHost Header Poisoning — Exploitation (CVE-2026-42271 / CVE-2026-48710) · unlock with TL Creds
- LiteLLM Proxy Spawning Unexpected Shell Subprocess — Post-Exploitation (CVE-2026-42271) · unlock with TL Creds
Indicators of compromise
As of 2026-11-16, Threadlinqs Intelligence tracks 41 indicators of compromise for TL-2026-0738.
Sample indicators (3 of 41)
- IP address:
45.150.109[.]151 - Domain:
oast[.]me - Domain:
oast[.]pro
Defanged, TLP:CLEAR. Full set of 41 indicators: unlock with TL Creds.
Technical analysis
Horizon3.ai demonstrated chaining it with CVE-2026-48710 (the Starlette 'BadHost' Host-header authentication bypass) to reach fully unauthenticated remote code execution (combined CVSS 10.0).
CVE-2026-42271 is a command injection vulnerability (CWE-77 / CWE-78) affecting the BerriAI LiteLLM proxy/AI-gateway from version 1.74.2 up to but not including 1.83.7 (i.e., 1.74.2 through 1.83.6). Two endpoints used to preview an MCP (Model Context Protocol) server before saving its configuration — POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list — accepted a full server configuration in the request body, including the command, args, and env fields used by the MCP stdio transport. When invoked with a stdio configuration, LiteLLM attempted to establish the connection, which spawned the attacker-supplied command as a subprocess on the proxy host with the privileges of the LiteLLM proxy process. The flaw therefore allowed any user holding a valid proxy API key, including low-privilege users, to achieve arbitrary OS command execution. NVD scores CVE-2026-42271 at CVSS 3.1 base 8.8 (vector AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
The LiteLLM advisory was published in early May 2026 and fixed in v1.83.7, which added authorization controls restricting the test endpoints to PROXY_ADMIN users and updated the Starlette dependency. CISA added CVE-2026-42271 to its Known Exploited Vulnerabilities (KEV) catalog on June 8, 2026 after evidence of active exploitation, and set a remediation deadline of June 22, 2026 for U.S. federal civilian executive branch (FCEB) agencies. No specific threat actor, campaign, or attribution was disclosed alongside the active-exploitation evidence.
The vulnerability becomes substantially more dangerous when chained with CVE-2026-48710 (CWE-444), the 'BadHost' Host-header validation bypass in the Starlette ASGI framework (affected versions 0.8.3 through 1.0.0, fixed in 1.0.1). In vulnerable Starlette, the HTTP Host request header is not validated before being used to reconstruct request.url. Because routing relies on the raw HTTP path while request.url is rebuilt from the Host header, a malformed header such as 'Host: target/allowpath?x=' makes request.url.path differ from the path actually requested, so path-based (allowlist / fail-closed) authentication middleware can be bypassed. Horizon3.ai disclosed (May 28, 2026) that this can be used to entirely sidestep the LiteLLM API-key requirement and reach the command-injection endpoints unauthenticated, transforming the bug into unauthenticated remote code execution with a combined CVSS of 10.0.
Post-exploitation, an attacker who reaches code execution on a LiteLLM host can access model-provider credentials, steal API keys and secrets stored by the proxy, and move laterally into connected AI infrastructure and downstream systems integrated with the gateway. BadHost is a framework-level flaw affecting FastAPI, vLLM, LiteLLM, Ray Serve, BentoML, MCP servers, Google ADK-Python, and any Python ASGI application that applies path-based auth middleware trusting request.url.path. Remediation: upgrade LiteLLM to >=1.83.7 and Starlette to >=1.0.1; if patching is not immediately possible, block the two /mcp-rest/test/* endpoints at a reverse proxy or API gateway, validate Host headers at a fronting proxy, restrict network access to trusted segments, and rotate proxy-stored credentials.
MITRE ATT&CK techniques by tactic:
Collection
Discovery
T1033 System Owner/User Discovery; T1082 System Information Discovery; T1083 File and Directory Discovery
Defense Evasion
T1036 Masquerading; T1211 Exploitation for Stealth
Exfiltration
T1041 Exfiltration Over C2 Channel; T1567 Exfiltration Over Web Service
Persistence
T1053.003 Scheduled Task/Job: Cron; T1098.004 Account Manipulation: SSH Authorized Keys
Execution
T1059 Command and Scripting Interpreter; T1059.004 Unix Shell; T1059.006 Python
Privilege Escalation
T1068 Exploitation for Privilege Escalation
Initial Access
T1133 External Remote Services; T1190 Exploit Public-Facing Application
Lateral Movement
T1210 Exploitation of Remote Services
Credential Access
T1212 Exploitation for Credential Access; T1528 Steal Application Access Token; T1552 Unsecured Credentials; T1552.001 Credentials In Files; T1552.005 Cloud Instance Metadata API
Impact
defense-impairment
T1556 Modify Authentication Process
Reconnaissance
Remediation
Patches
- LiteLLM v1.83.7-stable (restricts MCP test endpoints to PROXY_ADMIN role and updates Starlette)
- Starlette v1.0.1 (ignores Host headers containing invalid characters per RFC 9112 3.2 / RFC 3986 3.2.2)
Immediate actions
- Upgrade LiteLLM to v1.83.7 or later (BerriAI patched both the command injection and bumped the Starlette dependency)
- Upgrade Starlette to v1.0.1 or later to close the CVE-2026-48710 BadHost Host-header bypass
- If immediate patching is not possible, block POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list at the reverse proxy or API gateway
- Rotate all model-provider credentials, API keys, and secrets stored by or reachable from the LiteLLM proxy
Workarounds
- Block the /mcp-rest/test/* preview endpoints at the perimeter
- Disable or gate the MCP server preview/test functionality where not required
- Enforce Host-header validation at a reverse proxy as compensating control for unpatched Starlette
Longer-term hardening
- Place a fronting reverse proxy (nginx, Caddy, Traefik) that validates the HTTP Host header against an allowlist before requests reach the ASGI app
- Replace path-based auth middleware that trusts request.url.path with endpoint-level decorators (requires(), Depends(), Security()) or use scope['path'] instead of request.url.path
- Restrict network access to AI-gateway management/test endpoints to trusted administrative segments only
- Deploy EDR/behavioral monitoring on AI-gateway hosts to detect unexpected subprocess execution by the proxy process
Affected and fixed versions
- BerriAI — LiteLLM
Vulnerable versions: 1.74.2 through 1.83.6
Fixed in: 1.83.7 - Encode / Kludex — Starlette
Vulnerable versions: 0.8.3 through 1.0.0
Fixed in: 1.0.1
Timeline
Last updated · 3 updates · revalidated 3× · latest source
- BerriAI publishes GitHub Security Advisory GHSA-v4p8-mg3p-g94g and releases LiteLLM v1.83.7-stable, fixing CVE-2026-42271 by restricting the MCP test endpoints to PROXY_ADMIN users and updating the Starlette dependency. NVD publishes CVE-2026-42271 (CVSS 8.8).
- Starlette v1.0.1 released, fixing CVE-2026-48710 BadHost by rejecting Host headers containing invalid characters per RFC 9112 3.2 / RFC 3986 3.2.2. Encode/Kludex publish GitHub Security Advisory GHSA-86qp-5c8j-p5mr.
- CVE-2026-48710 ('BadHost') Starlette Host-header authentication bypass disclosed by X41 D-Sec and Nicolas Lamoureux, coordinated by OSTIF. NVD publishes the CVE (CVSS 6.5, CWE-444).
- CSO Online and the CCB Belgium issue advisories warning that FastAPI/Starlette-based AI tools (FastAPI, vLLM, LiteLLM, Ray Serve, BentoML, MCP servers, Google ADK-Python) are exposed to the BadHost authentication bypass.
- Horizon3.ai publishes research showing CVE-2026-42271 chained with CVE-2026-48710 to bypass authentication entirely and achieve unauthenticated remote code execution against LiteLLM (combined CVSS 10.0).
- CISA adds CVE-2026-42271 to the Known Exploited Vulnerabilities (KEV) catalog citing evidence of active exploitation in the wild.
- Help Net Security and The Hacker News report on active exploitation and the CISA KEV addition; SoCRadar and CSO Online publish analysis of the LiteLLM RCE and Starlette BadHost chain.
- CISA-mandated remediation deadline for U.S. federal civilian executive branch (FCEB) agencies to patch CVE-2026-42271.
- Microsoft publishes 'When AI infrastructure becomes the target,' documenting a coordinated, financially-motivated campaign that exploits the CVE-2026-42271/CVE-2026-48710 LiteLLM chain (alongside separate RAGFlow and Kestra CVEs) for credential harvesting, SSH/cron persistence with masquerading, and XMRig cryptomining.
- Cyber Security News and GBHackers report the campaign's C2 infrastructure, DNS-rebinding domain (locked-ioc-2), OAST callback domains, and XMRig mining-pool endpoint (locked-ioc-4) tied to the CVE-2026-42271/CVE-2026-48710 LiteLLM exploitation chain, alongside a public PoC (CVE-2026-42271-PoC).
- CVE-2026-48710 (Starlette BadHost) reportedly added to the CISA KEV catalog (secondary reporting and NVD reference; federal due date 2026-09-16).
- SANS ISC (diary 33522) reports weekend honeypot POSTs to /mcp-rest/test/tools/list with a stdio 'id' probe, a bogus bearer token, and malformed bracket-style Host headers ('localhost]', '[localhost', '127.0.0.1]', 'locked-ioc-6') that differ from the public PoC strings.
Update history
- 2026-11-16 — Scans for LiteLLM/Starlette Exploitation Chain: Unauthenticated RCE via CVE-2026-42271 + CVE-2026-48710 (BadHost): New evidence of continued in-the-wild exploitation attempts as of 2026-11-16. New indicators (8) Indicator values are withheld at this access level. New CVEs (0) None; both CVEs already tracked.
- 2026-08-27 — Hackers Exploit AI Infrastructure (LiteLLM, RAGFlow, Kestra) to Steal API Keys, Gain Persistence, and Mine Cryptocurrency: What changed No field escalations — severity (CRITICAL), exploitability (ACTIVE), status (ACTIVE), and attribution (Unknown/LOW) are unchanged; this update deepens evidence rather than escalating classification.
- 2026-08-27 — Coordinated Campaign Exploits LiteLLM, RAGFlow, and Kestra AI Gateways for Credential Theft, Persistence, and Cryptomining: What changed Attribution confidence NONE → LOW and motivation UNKNOWN → FINANCIAL: Microsoft (Aug 26, 2026) confirms the CVE-2026-42271/CVE-2026-48710 LiteLLM exploit chain is being used in a coordinated, opportunistic campaign targeting…
Sources cited
- CISA Known Exploited Vulnerabilities Catalog - CVE-2026-42271 CISA · Government advisory · 2026-06-08
- NVD - CVE-2026-42271 NVD (NIST) · Advisory · 2026-05-08
- NVD - CVE-2026-48710 NVD (NIST) · Advisory · 2026-05-26
- CCB Belgium Advisory: Starlette / FastAPI authentication bypass ccb.belgium.be · Advisory · 2026-05-27
- CVE-2026-42271: LiteLLM Unauthenticated RCE (chained with CVE-2026-48710) horizon3.ai · Research · 2026-05-28
- BadHost - CVE-2026-48710 Starlette Host-Header Auth Bypass badhost.org · Research · 2026-05-26
- X41 D-Sec Advisory X41-2026-002 Starlette x41-dsec.de · Research · 2026-05-26
- BerriAI LiteLLM GitHub Security Advisory GHSA-v4p8-mg3p-g94g GitHub · Code repository · 2026-05-08
- LiteLLM v1.83.7-stable release (patch) GitHub · Code repository · 2026-05-08
- Starlette GitHub Security Advisory GHSA-86qp-5c8j-p5mr GitHub · Code repository · 2026-05-26
- Disclosing the BADHOST Vulnerability in Starlette - OSTIF ostif.org · Blog · 2026-05-26
- CISA KEV Highlights LiteLLM RCE (CVE-2026-42271) & Check Point VPN Auth Bypass socradar.io · Blog · 2026-06-09
- LiteLLM vulnerability under active attack, CISA warns (CVE-2026-42271) Help Net Security · News · 2026-06-09
- LiteLLM Flaw CVE-2026-42271 Exploited in the Wild, Chains to Unauthenticated RCE The Hacker News · News · 2026-06-09
- FastAPI-based AI tools exposed to authentication bypass by flaw in Starlette framework csoonline.com · News · 2026-05-27
Other reports on CVE-2026-42271
- PoeLLM (Canto Incognito) malware infects exposed AI servers (LiteLLM, Ollama, Gotenberg, Gitea, Ivanti Sentry) in cryptomining attacks - CVE-2026-42271, CVE-2026-48710
- GTIG: AI-Era Vulnerability Discovery and Exploitation Surge — In-the-Wild Exploitation of BeyondTrust CVE-2026-1731, LiteLLM CVE-2026-42271 and Langflow CVE-2026-5027
Previous and next in vulnerability
- Microsoft June 2026 Patch Tuesday — 198+ CVEs Including CVE-2026-49160 (HTTP.sys 'HTTP/2 Bomb' DoS), CVE-2026-50507 (BitLocker 'YellowKey' Bypass) and CVE-2026-45586 (Collaborative Translation Framework EoP) Previous report
- CVE-2026-11645: Actively Exploited V8 Out-of-Bounds Memory Access Zero-Day in Google Chrome Next report
Drafted by the Threadlinqs research pipeline from 15 sources; published ; last updated .