The PHP HTTP stream wrapper in versions prior to the CVE-2026-91766 fix re-binds the original request's Authorization, Cookie, and Proxy-Authorization headers to every hop in a redirect chain, regardless of whether the Location: target shares the origin, port, and scheme. The fix is a small conditional in the 3xx handling path — under 20 lines — that drops sensitive headers when any of those change. Structurally, it is the same lesson libcurl learned in CVE-2018-1000007, and the same one Python's urllib2 hit in 2005, Apache HttpClient in 2011, and Python's urllib again in 2014. Twenty years of rediscovery, fixed independently in each codebase, never traveling between them.
Three things make this worse than the CVSS 5.9 suggests. First, the Proxy-Authorization vector: long-lived corporate egress credentials with low rotation discipline can be steered to attacker-chosen origins by any open redirect, typo-squatted host, or metadata endpoint in the chain. One 302 unlocks a persistent exfiltration channel. Second, PHP's existing safety rails do not cover this axis. open_basedir and allow_url_fopen are orthogonal to header forwarding, and the credential leak happens before the wrapper's policy checks resolve — headers cross the trust boundary first, and the allow-list fires second. Third, the fix landing in php-src is not the end of the exposure. WordPress installations on PHP 7.x LTS, shared-hosting PHP builds, and frameworks wrapping file_get_contents inherit the buggy code; vendor backports will drift from the upstream patch.
Patch immediately, then audit every fopen, file_get_contents, and stream context call that carries Authorization or Proxy-Authorization against a URL you do not control. Rotate Proxy-Authorization credentials on any PHP deployment that handled a redirect since 2018.