[php-src] PR #25881: Fix GH-25880: HTTP wrapper resolves "//host/path" Location against the original host
| From: | matyapiro31 | Date: | Sat, 28 Nov 2026 17:51:19 +0000 |
| Subject: | [php-src] PR #25881: Fix GH-25880: HTTP wrapper resolves "//host/path" Location against the original host | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41167@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25881
Author: matyapiro31
Fixes GH-25880.
A
Location value starting with // is a network-path reference (RFC 3986
section 4.2) that replaces authority and path while keeping the scheme. The redirect code only
distinguished absolute URLs from values starting with a single /, so
//other.example/x was sent as the request target //other.example/x to the
original host.
This treats it as a network-path reference and prefixes the current scheme. The resulting URL goes
through the existing same_origin check, so credentials are still stripped when the host
differs.
Other relative forms (?query-only, dot segments) are intentionally left unchanged.
The target is PHP-8.4 as a bug fix, but this changes where a redirect goes, so moving it to master
only is fine if maintainers prefer.
🤖 Generated with [Claude Code](https://claude.com/claude-code)