]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.22] net/http, net/http/cookiejar: avoid subdomain matches on...
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 16:43:48 +0000 (16:43 +0000)
commit3a855208e3efed2e9d7c20ad023f1fa78afcc0be
treed69f1b22baeb446a10a68965385d284fa1eaf38b
parent337b8e9cbfa749d9d5c899e0dc358e2208d5e54f
[release-branch.go1.22] 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 #65859
For #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://team-review.git.corp.google.com/c/golang/go-private/+/2174344
Reviewed-by: Carlos Amedee <amedee@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/569236
Reviewed-by: Carlos Amedee <carlos@golang.org>
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/cookiejar/jar.go
src/net/http/cookiejar/jar_test.go