CVE-2026-42271: LiteLLM Authenticated Command Execution Vulnerability
HIGHCVE-2026-42271 is a HIGH (CVSS 8.8) authenticated command execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting LiteLLM libraries in the PyPI ecosystem. The issue involves authenticated command execution via mcp stdio test endpoints. Remediation is available by upgrading affected packages to version 1.83.7.
CVE-2026-42271 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-42271
To remediate this vulnerability, upgrade all affected LiteLLM dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install litellm>=1.83.7
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show litellm
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-42271, inspect your installed packages using pip:
pip show litellm
Analyze the terminal output to locate any version of LiteLLM in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.83.7), your application is affected.
Note: The pip show litellm command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In LiteLLM, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-42271 Affected LiteLLM Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
litellm
|
PyPI |
≥ 1.74.2
< 1.83.7
|
1.83.7
|
References
Frequently Asked Questions
What is CVE-2026-42271?
Which LiteLLM versions are affected?
What version fixes CVE-2026-42271?
Is litellm affected?
What is the CVSS score of CVE-2026-42271?
What CWE is associated with CVE-2026-42271?
How can I check PyPI dependencies for CVE-2026-42271?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v4p8-mg3p-g94g",
"modified" : "2026-06-09T13:07:06Z",
"published" : "2026-04-25T23:27:54Z",
"aliases" : [ "CVE-2026-42271" ],
"summary" : "LiteLLM: Authenticated command execution via MCP stdio test endpoints",
"details" : "### Impact\n\nTwo 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.\n\nThe 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.\n\n### Patches\n\nFixed in **`1.83.7`**. Both test endpoints now require the `PROXY_ADMIN` role, bringing them into line with the save endpoint.\n\n### Workarounds\n\nIf 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "litellm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.74.2"
}, {
"fixed" : "1.83.7"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/BerriAI/litellm/security/advisories/GHSA-v4p8-mg3p-g94g"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42271"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/BerriAI/litellm"
}, {
"type" : "WEB",
"url" : "https://github.com/BerriAI/litellm/releases/tag/v1.83.7-stable"
}, {
"type" : "WEB",
"url" : "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-42271"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-77", "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-25T23:27:54Z",
"nvd_published_at" : "2026-05-08T04:16:21Z"
}
}