| Title | litellm <= 1.82.2 Server-Side Request Forgery (SSRF) (CWE-918) |
|---|
| Description | # Technical Details
A Server-Side Request Forgery (SSRF) vulnerability exists in the `_execute_with_mcp_client` method in `litellm/proxy/_experimental/mcp_server/rest_endpoints.py` of litellm.
The test-connection management route lacks sufficient architectural boundaries, allowing arbitrary end-users to specify a `token_url` to which the proxy will emit a direct blind POST request loaded with an injected `client_id` and `client_secret`.
# Vulnerable Code
File: `litellm/proxy/_experimental/mcp_server/rest_endpoints.py`
Method: `_execute_with_mcp_client`
Why: Providing the attributes forces `_oauth2_flow = "client_credentials"` and flags the `has_client_credentials = True`. The `mcp_oauth2_token_cache` then triggers an unvalidated outbound HTTP POST directly against `request.token_url`.
# Reproduction
1. Set up a netcat listener on a protected inner network host (e.g., `nc -lvnp 8081`).
2. Send an authenticated HTTP POST payload to `/v1/mcp/test/connection` embedding the `client_id`, `client_secret`, and pointing `token_url` at your inner target (`http://host.docker.internal:8081/internal/token`).
3. Observe the SSRF hit receiving the `application/x-www-form-urlencoded` HTTP POST containing the secrets.
# Impact
- Server-Side Request Forgery (SSRF) against internal network enclaves.
- Leakage of secrets via outbound injection targeting external servers.
- The ability to toggle stateless states inside microservices isolated from external view via malformed POST invocations. |
|---|
| Source | ⚠️ https://gist.github.com/YLChen-007/256c8ff0750e298f89b6b287c90c2981 |
|---|
| User | Eric-c (UID 96848) |
|---|
| Submission | 04/23/2026 10:05 (2 months ago) |
|---|
| Moderation | 06/20/2026 11:26 (2 months later) |
|---|
| Status | Accepted |
|---|
| VulDB entry | 372516 [BerriAI litellm up to 1.82.2 MCP Server Connection Testing rest_endpoints.py _execute_with_mcp_client server-side request forgery] |
|---|
| Points | 20 |
|---|