| عنوان | litellm <= 1.82.2 Server-Side Request Forgery (SSRF) (CWE-918) |
|---|
| الوصف | # 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. |
|---|
| المصدر | ⚠️ https://gist.github.com/YLChen-007/256c8ff0750e298f89b6b287c90c2981 |
|---|
| المستخدم | Eric-c (UID 96848) |
|---|
| ارسال | 23/04/2026 10:05 AM (2 أشهر منذ) |
|---|
| الاعتدال | 20/06/2026 11:26 AM (2 months later) |
|---|
| الحالة | تمت الموافقة |
|---|
| إدخال VulDB | 372516 [BerriAI litellm حتى 1.82.2 MCP Server Connection Testing rest_endpoints.py _execute_with_mcp_client تجاوز الصلاحيات] |
|---|
| النقاط | 20 |
|---|