mirror of
https://github.com/openai/codex.git
synced 2026-09-07 15:40:00 +00:00
## Why MCP requests can contain sensitive headers and tool-call bodies. Following a cross-origin redirect could disclose them to another server. ## What changed - Follow redirects only when every hop remains on the configured server's origin, and require HTTPS for redirects on non-loopback hostnames. - Preserve standard redirect method and body handling while sharing the original timeout and enforcing a 10-hop limit. - Avoid replaying plaintext proxy credentials across redirects, while leaving OAuth requests that stop at redirects unchanged. ## Testing Add coverage for same-origin and cross-origin redirects, redirect methods, headers and bodies, proxy credentials, timeouts, hop limits, and legacy MCP tool calls. GitOrigin-RevId: 3e267911a1665ad8c2fc63825099a758770f4d68