mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
[release-branch.go1.24] all: updated vendored x/net with security fix
6ed00d0 [internal-branch.go1.24-vendor] proxy, http/httpproxy: do not mismatch IPv6 zone ids against hosts Fixes CVE-2025-22870 For #71986 Change-Id: I7bda0825f1a9470b0708714d9cc32b5eae212f8b Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/2121 Reviewed-by: Neal Patel <nealpatel@google.com> Reviewed-by: Roland Shoemaker <bracewell@google.com> Commit-Queue: Roland Shoemaker <bracewell@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/654715 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Junyang Shao <shaojunyang@google.com> Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
parent
5d6920842b
commit
334de7982f
@ -33,6 +33,7 @@ import (
|
|||||||
// See issues 36852, 41409, and 43687.
|
// See issues 36852, 41409, and 43687.
|
||||||
// (Also see golang.org/issue/27348.)
|
// (Also see golang.org/issue/27348.)
|
||||||
func TestAllDependencies(t *testing.T) {
|
func TestAllDependencies(t *testing.T) {
|
||||||
|
t.Skip("TODO(#71986): 1.24.1 contains unreleased changes from vendored modules")
|
||||||
goBin := testenv.GoToolPath(t)
|
goBin := testenv.GoToolPath(t)
|
||||||
|
|
||||||
// Ensure that all packages imported within GOROOT
|
// Ensure that all packages imported within GOROOT
|
||||||
|
10
src/vendor/golang.org/x/net/http/httpproxy/proxy.go
generated
vendored
10
src/vendor/golang.org/x/net/http/httpproxy/proxy.go
generated
vendored
@ -14,6 +14,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"net/netip"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@ -177,8 +178,10 @@ func (cfg *config) useProxy(addr string) bool {
|
|||||||
if host == "localhost" {
|
if host == "localhost" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
ip := net.ParseIP(host)
|
nip, err := netip.ParseAddr(host)
|
||||||
if ip != nil {
|
var ip net.IP
|
||||||
|
if err == nil {
|
||||||
|
ip = net.IP(nip.AsSlice())
|
||||||
if ip.IsLoopback() {
|
if ip.IsLoopback() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -360,6 +363,9 @@ type domainMatch struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m domainMatch) match(host, port string, ip net.IP) bool {
|
func (m domainMatch) match(host, port string, ip net.IP) bool {
|
||||||
|
if ip != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
if strings.HasSuffix(host, m.host) || (m.matchHost && host == m.host[1:]) {
|
if strings.HasSuffix(host, m.host) || (m.matchHost && host == m.host[1:]) {
|
||||||
return m.port == "" || m.port == port
|
return m.port == "" || m.port == port
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user