# CVE-2026-42271: BerriAI LiteLLM OS command injection in MCP test endpoints

Source: https://junglewise.ai/threats/cve-2026-42271-berriai-litellm-os-command-injection-in-mcp-test-endpoints  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-08. Updated: 2026-06-09  
License: CC BY 4.0 with a link back

CVE-2026-42271 · Severity: critical · CVSS 8.8 · Exploited in the wild · Published 2026-05-08

LiteLLM is a tool used to manage and interface with various AI models. A security flaw in its testing interface allowed any authenticated user to execute arbitrary system commands on the server hosting the application. This could lead to a complete system takeover, unauthorized access to sensitive AI configurations, or data theft by anyone with a basic API key.

Technologies: [Berriai LiteLLM](https://junglewise.ai/threats/technologies/litellm), [litellm (PyPI)](https://junglewise.ai/threats/technologies/pypi-litellm). Vendors: [Berriai](https://junglewise.ai/threats/vendors/berriai), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-42271 exploited in the wild?** Yes. CVE-2026-42271 is known to be exploited in the wild, first recorded on 8 June 2026. Treat it as urgent.

**How severe is CVE-2026-42271?** Critical severity, with a CVSS score of 8.8, published 8 May 2026.

**Which products and versions are affected?** Berriai LiteLLM >= 1.74.2, < 1.83.7, >=1.74.2, <1.83.7, 1.74.2 to 1.83.6; litellm (PyPI) ECOSYSTEM:introduced=1.74.2,fixed=1.83.7.

**Is there a fix for CVE-2026-42271?** Yes. litellm (PyPI): upgrade to 1.83.7 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-42271 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-42271?** Check whether you run Berriai LiteLLM or litellm (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- litellm (PyPI): upgrade to 1.83.7 or later

  ```sh
  pip install "litellm>=1.83.7"
  ```


## Technical details

LiteLLM is vulnerable to OS command injection in the `POST /mcp-rest/test/connection` and `POST /mcp-rest/test/tools/list` endpoints. These endpoints, used for previewing Model Context Protocol (MCP) server configurations, accepted `command`, `args`, and `env` fields in the request body. When processed, the application spawned these inputs as subprocesses on the host using the stdio transport. The vulnerability was exacerbated by a lack of role-based access control (RBAC); any user with a valid proxy API key could access these endpoints regardless of their privilege level. Attackers can achieve full remote code execution (RCE) on the proxy host. The issue is fixed in version 1.83.7 by enforcing the PROXY_ADMIN role for these endpoints.

## Affected products

- BerriAI litellm >= 1.74.2, < 1.83.7

## Identifiers

- CVE-2026-42271
- GHSA-v4p8-mg3p-g94g
- PYSEC-2026-2599

## Timeline

- 2026-04-19: patched: Version 1.83.7 released
- 2026-04-21: disclosed
- 2026-04-25: advisory

## References

- [https://github.com/BerriAI/litellm/security/advisories/GHSA-v4p8-mg3p-g94g](https://github.com/BerriAI/litellm/security/advisories/GHSA-v4p8-mg3p-g94g)
- [https://github.com/BerriAI/litellm/releases/tag/v1.83.7-stable](https://github.com/BerriAI/litellm/releases/tag/v1.83.7-stable)
- [https://api.github.com/repos/BerriAI/litellm/security-advisories/GHSA-v4p8-mg3p-g94g](https://api.github.com/repos/BerriAI/litellm/security-advisories/GHSA-v4p8-mg3p-g94g)

## Related threats

- [LiteLLM arbitrary local file read via vertex_ai_credentials](https://junglewise.ai/threats/litellm-internal-user-viewer-arbitrary-local-file-read-via-vertex-ai-649a7475)
- [LiteLLM reflected XSS in SSO debug callback endpoint](https://junglewise.ai/threats/litellm-vulnerable-to-reflected-xss-in-sso-debug-callback-38154651)
- [LiteLLM proxy authentication bypass via reused crypto context](https://junglewise.ai/threats/cve-2026-114612-litellm-is-a-proxy-server-ai-gateway-to-call-llm-apis-in-openai)
- [BerriAI LiteLLM improper authorization in secret resolution](https://junglewise.ai/threats/cve-2026-108575-a-vulnerability-has-been-found-in-berriai-litellm-up-to-1-94-0)
- [BerriAI LiteLLM authorization bypass in spend tracking](https://junglewise.ai/threats/cve-2026-108574-a-flaw-has-been-found-in-berriai-litellm-up-to-1-95-0-affected)
