CVE-2026-42271 — litellm
CVE-2026-42271 is a CWE-77 vulnerability in litellm. EPSS puts its 30-day exploitation probability at 92.6% (100th percentile). A fix is available for litellm — see the affected versions and patch details below.
LiteLLM: Authenticated command execution via MCP stdio test endpoints
Exploitation Status
Actively exploited in the wild
- CISA’s SSVC triage classifies this CVE as under active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-42271.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
litellmReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Impact
Two endpoints used to preview an MCP server before saving it — 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 stdio transport. When called with a stdio configuration, the endpoints attempted to connect, which spawned the supplied command as a subprocess on the proxy host with the privileges of the proxy process.
The endpoints were gated only by a valid proxy API key, with no role check. Any authenticated user — including holders of low-privilege internal-user keys — could therefore run arbitrary commands on the host.
Patches
Fixed in 1.83.7. Both test endpoints now require the PROXY_ADMIN role, bringing them into line with the save endpoint.
Workarounds
If upgrading is not immediately possible, developers should block POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list at their reverse proxy or API gateway.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | litellm | ≥ 1.74.2&&< 1.83.7 | 1.83.7pip install --upgrade 'litellm==1.83.7' |
Affected Products
litellmlitellmopenshift airedhatDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for litellm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update litellm to 1.83.7 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-42271 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
How to detect CVE-2026-42271
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2026-42271 -u https://target- Template
- LiteLLM - Command Injection
- Severity
- critical
- Impact
- Successful exploitation allows unauthenticated remote attackers to execute arbitrary commands on affected LiteLLM instances, potentially leading to full system compromise, lateral movement, data theft, and persistent access.
- Remediation
- Upgrade LiteLLM to version 1.83.7 or later to remediate this vulnerability. If immediate patching is not possible, restrict access to the `/mcp-rest/test/connection` endpoint and ensure authentication verification is robust.
Template by ProjectDiscovery nuclei-templates (ritikchaddha), MIT licensed. View the full template. Scan only systems you are authorised to test.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This is an Important flaw affecting LiteLLM, as deployed in Red Hat products like Ansible Automation Platform and OpenShift AI. Authenticated users, even with low-privilege API keys, can execute arbitrary commands on the proxy host. This is due to insufficient role checks on specific endpoints that accept server…
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift AI 2.25 | rhoai/odh-llama-stack-core-rhel9:1781826406 | RHSA-2026:28960 |
| Red Hat OpenShift AI 3.3 | rhoai/odh-llama-stack-core-rhel9:1782310008 | RHSA-2026:30056 |
| Red Hat OpenShift AI 3.4 | rhoai/odh-trustyai-garak-lls-provider-dsp-rhel9:1781622627 | RHSA-2026:27784 |
Frequently Asked Questions
Is CVE-2026-42271 in your dependencies?
Find it across PyPI, including transitive dependencies.