mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
Two follow-ups to address Veria-AI findings on the PR. (1) Disable redirect-following on the OAuth outbound POSTs. validate_url only inspects the initial URL; httpx clients default to follow_redirects=True, so a malicious 30x from the validated host could bounce the proxy to an internal target. Add follow_redirects to the AsyncHTTPHandler.post wrapper (mirroring the existing get) and pass follow_redirects=False from both /token and /register flows. (2) Make get_mcp_server_by_name fail closed on None client_ip. The wrapper previously translated None to INTERNAL_REQUEST internally to preserve the "None means internal" convention, but that meant any external request handler that forgot to pass an IP silently bypassed gating. Update the wrapper to require an explicit sentinel for internal callers; update the four external callers in auth/user_api_key_auth_mcp.py and rest_endpoints.py to pass INTERNAL_REQUEST (where the lookup is metadata-only) or the real extracted client_ip. Adjust the test fixture in test_discoverable_endpoints.py to return INTERNAL_REQUEST instead of None so OAuth flow tests bypass IP gating explicitly. Update two stub lambdas in test_rest_endpoints.py to accept the new client_ip kwarg (CLAUDE.md: keep monkeypatch stubs in sync with real signatures). |
||
|---|---|---|
| .. | ||
| auth | ||
| guardrail_translation | ||
| test_byok_oauth_endpoints.py | ||
| test_db_credentials.py | ||
| test_discoverable_endpoints.py | ||
| test_is_tool_name_prefixed.py | ||
| test_jwt_mcp_enforcement.py | ||
| test_jwt_mcp_simple.py | ||
| test_mcp_cost_calculator.py | ||
| test_mcp_custom_fields.py | ||
| test_mcp_debug.py | ||
| test_mcp_discovery.py | ||
| test_mcp_hook_extra_headers.py | ||
| test_mcp_metadata_preservation.py | ||
| test_mcp_server.py | ||
| test_mcp_server_manager.py | ||
| test_mcp_sigv4_auth.py | ||
| test_mcp_stale_session.py | ||
| test_mcp_toolset_scope.py | ||
| test_oauth2_token_cache.py | ||
| test_openapi_to_mcp_generator.py | ||
| test_openapi_tool_auth.py | ||
| test_rest_endpoints.py | ||
| test_semantic_tool_filter.py | ||
| test_short_mcp_tool_prefix.py | ||
| test_ui_session_utils.py | ||