]> Cypherpunks repositories - gostls13.git/commit
net/http, net/http/cookiejar: avoid subdomain matches on IPv6 zones
authorDamien Neil <dneil@google.com>
Thu, 11 Jan 2024 19:31:57 +0000 (11:31 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 5 Mar 2024 18:31:54 +0000 (18:31 +0000)
commit821bf37819ec170cadbc9e44a7471f7613611c41
tree7eb97716b462b9e3ee1f080f3d791c696ba8a041
parentafb105056dc62b3f2f569341a9fff080023ee812
net/http, net/http/cookiejar: avoid subdomain matches on IPv6 zones

When deciding whether to forward cookies or sensitive headers
across a redirect, do not attempt to interpret an IPv6 address
as a domain name.

Avoids a case where a maliciously-crafted redirect to an
IPv6 address with a scoped addressing zone could be
misinterpreted as a within-domain redirect. For example,
we could interpret "::1%.www.example.com" as a subdomain
of "www.example.com".

Thanks to Juho Nurminen of Mattermost for reporting this issue.

Fixes CVE-2023-45289
Fixes #65065

Change-Id: I8f463f59f0e700c8a18733d2b264a8bcb3a19599
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2131938
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/569340
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
src/net/http/client.go
src/net/http/client_test.go
src/net/http/cookiejar/jar.go
src/net/http/cookiejar/jar_test.go