]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.26] net/url: reject IPv6 literal not at start of host
authorIan Alexander <jitsu@google.com>
Wed, 28 Jan 2026 20:29:52 +0000 (15:29 -0500)
committerGopher Robot <gobot@golang.org>
Fri, 6 Mar 2026 00:12:45 +0000 (16:12 -0800)
commit65c7d7a9fb3a9d1fbf1e702a211b8cc3a7bedb53
tree7822b025adf273b3e36fbdedf494c1b2ce74ccea
parente28ac674af90b079a7018ce8275885b3b5366d2a
[release-branch.go1.26] net/url: reject IPv6 literal not at start of host

This change rejects IPv6 literals that do not appear at the start of the
host subcomponent of a URL.

For example:
  http://example.com[::1] -> rejects
  http://[::1]            -> accepts

Thanks to Masaki Hara (https://github.com/qnighy) of Wantedly.

Updates #77578
Fixes #77970
Fixes CVE-2026-25679

Change-Id: I7109031880758f7c1eb4eca513323328feace33c
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3400
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3622
Reviewed-on: https://go-review.googlesource.com/c/go/+/752080
Auto-Submit: Gopher Robot <gobot@golang.org>
TryBot-Bypass: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/net/url/url.go
src/net/url/url_test.go