]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.24] crypto/x509: properly check for IPv6 hosts in URIs
authorRoland Shoemaker <bracewell@google.com>
Mon, 9 Dec 2024 19:31:22 +0000 (11:31 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 16 Jan 2025 19:08:59 +0000 (11:08 -0800)
commit468fad45a27db0ec1fff4ae397d3670795b3f977
tree06e25bd4812d13ae63075fc9d77eef730ed8cf9b
parente06b6fc58d635d4f2683bd0cbff0e89b33750e80
[release-branch.go1.24] crypto/x509: properly check for IPv6 hosts in URIs

When checking URI constraints, use netip.ParseAddr, which understands
zones, unlike net.ParseIP which chokes on them. This prevents zone IDs
from mistakenly satisfying URI constraints.

Thanks to Juho Forsén of Mattermost for reporting this issue.

For #71156
Fixes #71209
Fixes CVE-2024-45341

Change-Id: Iecac2529f3605382d257996e0fb6d6983547e400
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1700
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
(cherry picked from commit 22ca55d396ba801e6ae9b2bd67a059fcb30562fd)
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1800
Commit-Queue: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/643099
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/crypto/x509/name_constraints_test.go
src/crypto/x509/verify.go