litellm/tests/test_litellm/proxy/pass_through_endpoints
unknown 5ef39bea2e fix(security): strip proxy auth headers from pass_through_endpoints forwarding
When forward_headers=True on a generic pass_through_endpoint, the proxy's
own Authorization header (carrying the LiteLLM master/virtual key) was
forwarded verbatim to the upstream provider, and x-pass- prefixed headers
leaked through with the prefix intact alongside the stripped version.

Root cause: forward_headers_from_request only stripped content-length and
host before merging request headers into the outbound set. Auth headers
(authorization, api-key, x-api-key, x-goog-api-key) and x-pass- prefixed
headers were included raw.

Fix: strip all _PASS_THROUGH_PROTECTED_HEADERS and x-pass- prefixed
headers from request_headers before the merge. x-pass- entries are
snapshotted first so the prefix-stripping loop still processes them.
Also removes authorization and x-api-key from the WebSocket passthrough
forwarding allowlist (same leak vector).

Fixes #32202

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-07 16:25:18 +00:00
..
llm_provider_handlers fix(passthrough,streaming): recover cost on interrupted and agentic Anthropic streams (#31035) 2026-06-22 18:51:13 -07:00
test_carry_guardrail_logging_info.py fix(passthrough): emit otel guardrail span when a guardrail blocks (#29470) 2026-06-02 11:46:25 -07:00
test_llm_pass_through_endpoints.py feat(proxy): enforce key/team guardrails on bedrock passthrough routes (#30194) 2026-06-12 07:23:29 -07:00
test_method_specific_routing.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_pass_through_endpoints.py fix(proxy): stop double-logging and false-alerting on passthrough upstream errors 2026-07-04 12:41:16 -07:00
test_passthrough_auth_default.py fix(passthrough): default auth=True; drop enterprise gate on the safe option 2026-04-29 23:10:59 +00:00
test_passthrough_endpoints_common_utils.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_passthrough_guardrail_block_otel_span.py fix: missing span for guardrail passthrough (#29552) 2026-06-03 01:25:15 +00:00
test_passthrough_guardrails.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_passthrough_guardrails_field_targeting.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_passthrough_post_call_guardrails.py fix(proxy): extend response headers hook to streaming, TTS, image gen, and pass-through (#24232) 2026-06-09 22:10:23 +02:00
test_streaming_handler_interrupt.py fix(streaming): stamp completion_start_time on first chunk for /v1/messages and /v1/responses (#32284) 2026-07-06 19:30:31 -07:00
test_vertex_ai_batch_passthrough.py test(e2e): add live batches suite across providers and routing scenarios (#30958) 2026-07-02 08:05:23 -07:00
test_vertex_passthrough_load_balancing.py fix(security): strip proxy auth headers from pass_through_endpoints forwarding 2026-07-07 16:25:18 +00:00
test_watsonx_proxy_route.py Litellm OSS Staging 010626 (#29422) 2026-06-01 21:42:51 -07:00