Skip to content
Xianzhi Community (Aliyun)·Indexed by this site · Originally published· Event →SelectedAttention42

Reproducing the CVE-2026-59822 authentication bypass and command execution vulnerability in the LiteLLM MCP channel

复现LiteLLM MCP通道CVE-2026-59822认证绕过与命令执行漏洞

AI summary

The authors reproduce CVE-2026-59822 in the MCP channel of litellm 1.83.6: a nonexistent Bearer token is enough to complete the handshake and invoke a tool that executes shell commands, with the command running as a subprocess. Source code localization shows that when a request with an Authorization header fails authentication with an exception code of 401/403, it is passed through as an upstream OAuth2 token, and an empty authentication object is constructed to let it through; disabling allow_all_keys only blocks tool invocation, and the handshake still returns 200. The authors also demonstrate that /mcp-rest/test/connection, under an admin key, starts a subprocess to execute commands according to the request body, and the command has already executed when the connection test reports failure; the command whitelist only compares the basename, so interpreters such as python3 can bypass it. The article ends with remediation suggestions such as not constructing an empty authentication object, changing passthrough to an explicit switch, unifying exception mapping, and running in containers.

Why it was selected

The authors use controlled experiments and source code localization to explain how a fake token is accepted as an upstream OAuth2 token, and that disabling allow_all_keys only blocks tool invocation, not authentication.

Read originalxz.aliyun.com