]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.24] net/http: persist header stripping across repeated redirects
authorDamien Neil <dneil@google.com>
Fri, 22 Nov 2024 20:34:11 +0000 (12:34 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 16 Jan 2025 19:36:03 +0000 (11:36 -0800)
commit6b605505047416bbbf513bba1540220a8897f3f6
treed8594de861fccbb002ceda258a6e5fb3a2aa4294
parent468fad45a27db0ec1fff4ae397d3670795b3f977
[release-branch.go1.24] net/http: persist header stripping across repeated redirects

When an HTTP redirect changes the host of a request, we drop
sensitive headers such as Authorization from the redirected request.
Fix a bug where a chain of redirects could result in sensitive
headers being sent to the wrong host:

  1. request to a.tld with Authorization header
  2. a.tld redirects to b.tld
  3. request to b.tld with no Authorization header
  4. b.tld redirects to b.tld
  3. request to b.tld with Authorization header restored

Thanks to Kyle Seely for reporting this issue.

For #70530
Fixes #71212
Fixes CVE-2024-45336

Change-Id: Ia58a2e10d33d6b0cc7220935e771450e5c34de72
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1641
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Commit-Queue: Roland Shoemaker <bracewell@google.com>
(cherry picked from commit 2889169b87a61f1218a02994feb80fd3d8bfa87c)
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1766
Reviewed-on: https://go-review.googlesource.com/c/go/+/643100
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/net/http/client.go
src/net/http/client_test.go
src/net/http/internal/testcert/testcert.go