]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] 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:07:07 +0000 (11:07 -0800)
commitb72d56f98d6620ebe07626dca4bb67ea8e185379
tree817a60ffc8a0d4a893481062f2334d88b231b69f
parent19d21034157ba69d0f54318a9867d9b08730efcb
[release-branch.go1.22] 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.

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

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>
Change-Id: Id7b1e3c90345566b8ee1a51f65dbb179da6eb427
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1765
Reviewed-on: https://go-review.googlesource.com/c/go/+/643106
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
src/net/http/client.go
src/net/http/client_test.go
src/net/http/internal/testcert/testcert.go