LiteLLM has emerged as the backbone for enterprise AI orchestration, sitting between your developers and the LLM providers they consume. On January 7, 2026, the Zero Day Initiative (ZDI) published advisory ZDI-26-1031 detailing an unpatched command injection vulnerability in LiteLLM's Model Context Protocol (MCP) implementation. This isn't theoretical fuzzing — this is a straight path from authenticated API calls to arbitrary code execution on your AI gateway.
For defenders, this vulnerability represents a critical failure point in the modern AI supply chain. LiteLLM typically holds privileged credentials for every major LLM provider (OpenAI, Anthropic, Azure OpenAI) and often runs with elevated network access to reach internal data sources. Compromising the LiteLLM instance means compromising your entire AI infrastructure pipeline.
Technical Analysis: MCP Parameter Injection
Affected Product: LiteLLM (Python package and proxy deployment) Affected Component: MCP (Model Context Protocol) tool execution handler CVSS Score: 7.2 (High) Advisory ID: ZDI-26-1031
The Attack Surface
LiteLLM supports the Model Context Protocol (MCP), allowing AI agents to dynamically invoke tools and functions. The vulnerability exists in how the MCP implementation sanitizes tool execution arguments before passing them to the underlying shell or subprocess.
Attack Chain:
- Initial Access: Attacker possesses valid API credentials or hijacks an existing session token (this is the authentication requirement noted in the ZDI advisory — the report text appears truncated, but "authentication required" is the definitive precondition).
- Tool Invocation: Attacker submits a crafted MCP tool request containing shell metacharacters (
;,|,&&,$(), or backticks) within the tool arguments. - Command Injection: LiteLLM fails to properly escape these metacharacters when constructing the command line for the MCP server subprocess.
- Code Execution: The injected commands execute with the privileges of the LiteLLM service account.
Why MCP is High-Risk
Unlike traditional SQL injection that accesses data, MCP command injection targets the orchestration layer. The MCP server often executes with filesystem access to vector databases, configuration files, and API keys. In containerized deployments, this frequently means access to the /app directory containing .env files with cloud provider credentials.
Exploitation Status: As of publication, no public PoC is available and CISA KEV has not yet listed this vulnerability. However, ZDI advisories typically follow responsible disclosure timelines, meaning public exploit code often surfaces 30-90 days after advisory publication. The 7.2 CVSS score reflects the authentication requirement, but post-authentication exploitation is trivial once credentials are obtained.
Detection & Response
Sigma Detection Rules
Deploy these rules to detect suspicious process creation patterns associated with MCP exploitation.
---
title: LiteLLM MCP Command Injection via Process Creation
id: 4a8f2e91-7c3b-4d5e-9f1a-2b8c6d4e5f7a
status: experimental
description: Detects suspicious child processes spawned by LiteLLM proxy or MCP servers indicative of command injection exploitation.
references:
- http://www.zerodayinitiative.com/advisories/ZDI-26-1031/
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/01/07
tags:
- attack.execution
- attack.t1059.004
- attack.t1190
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith:
- '\python.exe'
- '\pythonw.exe'
- '\uvicorn.exe'
- '\gunicorn.exe'
selection_suspicious_children:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\pwsh.exe'
- '\wscript.exe'
- '\cscript.exe'
- '\mshta.exe'
- '\certutil.exe'
- '\bitsadmin.exe'
- '\curl.exe'
- '\wget.exe'
condition: selection_parent and selection_suspicious_children
falsepositives:
- Legitimate administrative scripts run via LiteLLM
- Development environments with MCP debugging enabled
level: high
---
title: LiteLLM MCP Server Spawning Shell Commands
id: 8b3e4f2a-9d1c-4e6b-8a5f-3c7d9e2f4b6a
status: experimental
description: Detects LiteLLM MCP server processes executing shell interpreters, which should never occur in normal operation.
references:
- http://www.zerodayinitiative.com/advisories/ZDI-26-1031/
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/01/07
tags:
- attack.execution
- attack.t1059
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith:
- '/python'
- '/python3'
- '/uvicorn'
selection_shell:
Image|endswith:
- '/sh'
- '/bash'
- '/zsh'
- '/dash'
- '/ksh'
- '/csh'
- '/tcsh'
condition: selection_parent and selection_shell
falsepositives:
- Legitimate MCP tool implementations requiring shell access
- Maintenance scripts during deployment windows
level: high
---
title: LiteLLM MCP Command Line Injection Patterns
id: 9c4d5e3f-8a2b-4c7d-9e1f-5a6b8c3d7e9f
status: experimental
description: Detects command injection attempts in LiteLLM MCP tool arguments via suspicious shell metacharacters.
references:
- http://www.zerodayinitiative.com/advisories/ZDI-26-1031/
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/01/07
tags:
- attack.execution
- attack.t1059
logsource:
category: process_creation
detection:
selection_metacharacters:
CommandLine|contains:
- ';'
- '&&'
- '||'
- '$('
- '`'
- '|'
selection_context:
CommandLine|contains:
- 'mcp'
- 'litellm'
- '--tool'
condition: selection_metacharacters and selection_context
falsepositives:
- Complex legitimate tool arguments with special characters
- Development environments with verbose logging
level: medium
KQL Hunt Query for Microsoft Sentinel
This query hunts for process creation events where LiteLLM-related processes spawn shells or administrative tools. Deploy against both Windows and Linux logs ingested via Syslog/CEF.
// Hunt for LiteLLM MCP exploitation via suspicious child processes
union isfuzzy=true
(SecurityEvent
| where EventID == 4688
| where NewProcessName has_any ("cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe", "certutil.exe", "bitsadmin.exe", "curl.exe", "wget.exe")
| where ParentProcessName has_any ("python.exe", "pythonw.exe", "uvicorn.exe", "gunicorn.exe")
| extend SuspiciousProcess = NewProcessName, Parent = ParentProcessName
| project TimeGenerated, Computer, Account, SuspiciousProcess, Parent, CommandLine),
(Syslog
| where Facility == "user" and SeverityLevel == "info"
| where ProcessName in ("sh", "bash", "zsh", "dash", "ksh")
| where SyslogMessage contains "litellm" or SyslogMessage contains "mcp"
| extend SuspiciousProcess = ProcessName, Parent = "python"
| project TimeGenerated, Computer, HostName, SuspiciousProcess, Parent, SyslogMessage)
| sort by TimeGenerated desc
Velociraptor VQL Hunt
Use this VQL artifact for enterprise-wide hunting across Linux and Windows endpoints running LiteLLM.
-- Hunt for suspicious processes spawned by LiteLLM or MCP servers
SELECT Pid, Name, CommandLine, Exe, Username, CreateTime, Ppid
FROM pslist()
WHERE (Name =~ '^(sh|bash|zsh|dash|cmd|powershell|pwsh|wscript|cscript|mshta|certutil|bitsadmin|curl|wget)$'
OR Exe =~ '(sh|bash|cmd|powershell|pwsh)$')
AND (CommandLine =~ '(python|litellm|mcp)'
OR Ppid IN (SELECT Pid FROM pslist() WHERE Name =~ 'python|uvicorn'))
ORDER BY CreateTime DESC
Immediate Mitigation Script
While awaiting an official patch, deploy this Bash script to isolate LiteLLM services and enable enhanced logging.
#!/bin/bash
# LiteLLM ZDI-26-1031 Mitigation Script
# Run on LiteLLM proxy hosts
set -euo pipefail
echo "[*] Starting LiteLLM hardening for ZDI-26-1031..."
# 1. Identify running LiteLLM processes
LITELLM_PIDS=$(pgrep -f "litellm" || true)
if [ -n "$LITELLM_PIDS" ]; then
echo "[!] Found LiteLLM processes: $LITELLM_PIDS"
echo "[!] Consider stopping LiteLLM until patched: sudo systemctl stop litellm-proxy"
fi
# 2. Block MCP server external network access (if using iptables)
if command -v iptables &> /dev/null; then
echo "[*] Applying network restrictions to LiteLLM user..."
# Create chain for LiteLLM restrictions
sudo iptables -N LITELLM_OUT 2>/dev/null || true
# Block outbound except localhost and approved API endpoints
sudo iptables -A LITELLM_OUT -p tcp --dport 443 -d api.openai.com -j ACCEPT 2>/dev/null || true
sudo iptables -A LITELLM_OUT -p tcp --dport 443 -d api.anthropic.com -j ACCEPT 2>/dev/null || true
sudo iptables -A LITELLM_OUT -j DROP 2>/dev/null || true
# Apply to litellm user (adjust UID as needed)
sudo iptables -A OUTPUT -m owner --uid-owner litellm -j LITELLM_OUT 2>/dev/null || echo "[!] Could not apply owner match - manual iptables config required"
fi
# 3. Enable verbose logging for MCP operations
if [ -f "/etc/litellm/config.yaml" ]; then
echo "[*] Enabling debug logging in config.yaml..."
sudo sed -i 's/log_level: WARNING/log_level: DEBUG/' /etc/litellm/config.yaml || echo "[!] Config edit failed"
fi
# 4. Disable MCP tool execution if not required (BREAKS FUNCTIONALITY)
if [ -f "/etc/litellm/.env" ]; then
echo "[*] Checking for MCP disable flag..."
if ! grep -q "DISABLE_MCP_TOOLS" /etc/litellm/.env; then
echo "DISABLE_MCP_TOOLS=true" | sudo tee -a /etc/litellm/.env
echo "[!] MCP tools disabled - restart LiteLLM to apply"
fi
fi
# 5. Audit for suspicious processes
echo "[*] Checking for suspicious child processes..."
ps aux | grep -E "(python|litellm)" | grep -v grep | while read line; do
pid=$(echo "$line" | awk '{print $2}')
children=$(pgrep -P "$pid" | wc -l)
if [ "$children" -gt 0 ]; then
echo "[!] PID $pid has $children children: $(pgrep -P "$pid" | tr '\n' ' ')"
fi
done
echo "[*] Mitigation complete. Monitor logs at /var/log/litellm.log"
Remediation Strategy
Immediate Actions (0-24 hours):
-
Isolate the LiteLLM Admin Console: Ensure the administrative interface is not exposed to the internet or broad internal networks. Implement IP allowlisting for the
/adminand/uiendpoints. -
Rotate API Credentials: Assume any LiteLLM API keys with
master_keyor admin privileges are compromised. Rotate all provider credentials stored in LiteLLM (OpenAI, Anthropic, Azure, etc.). -
Network Segmentation: Move LiteLLM proxies into a dedicated VLAN with no direct internet access except through approved API egress filters.
-
Disable MCP if Unused: If your organization is not actively using Model Context Protocol tools, disable the MCP server entirely via configuration:
export LITELLM_MCP_ENABLED=false.
Short-term Actions (1-7 days):
- Apply Principle of Least Privilege: Run LiteLLM as a non-root user with minimal filesystem access. Use systemd sandboxing directives:
INI
ProtectSystem=strict ReadWritePaths=/var/log/litellm /tmp NoNewPrivileges=true PrivateTmp=true
2. **Input Validation Layer:** Deploy a WAF or API gateway in front of LiteLLM to filter MCP requests containing shell metacharacters (`;`, `|`, `&`, `$()`, backticks) in JSON arguments.
3. **Monitor for Updates:** Watch the LiteLLM GitHub repository (berriai/litellm) for security patches. ZDI-26-1031 indicates an unpatched state as of January 2026.
**Long-term Actions (1-4 weeks):**
1. **Implement Egress Filtering:** Restrict LiteLLM containers to communicate only with approved LLM provider endpoints (api.openai.com, api.anthropic.com, etc.) and internal vector databases.
2. **Deploy Runtime Security:** Use Falco or similar runtime security tools to detect anomalous process creation in LiteLLM containers, particularly shell executions from Python processes.
3. **Supply Chain Review:** Audit your AI infrastructure stack. LiteLLM is often one component in a chain that includes vector databases (Pinecone, Weaviate), embedding models, and data loaders. Ensure each component has equivalent monitoring.
## Related Resources
[Security Arsenal Penetration Testing Services](https://securityarsenal.com/services/penetration-testing)
[AlertMonitor Platform](https://securityarsenal.com/products/alertmonitor)
[Book a SOC Assessment](https://securityarsenal.com/contact)
[vulnerability-management Intel Hub](https://securityarsenal.com/intel/incident-response)
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.