]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.21] 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:51:34 +0000 (16:51 +0000)
commit20586c0dbe03d144f914155f879fa5ee287591a1
tree619ac3882246cadc59964c5001ff1afef65f9d97
parentbe5b52bea674190ef7de272664be6c7ae93ec5a0
[release-branch.go1.21] 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 #65385
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/+/2173775
Reviewed-by: Carlos Amedee <amedee@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/569239
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
TryBot-Bypass: 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