]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.24] crypto/x509: rework fix for CVE-2025-58187
authorRoland Shoemaker <roland@golang.org>
Thu, 9 Oct 2025 20:35:24 +0000 (13:35 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 13 Oct 2025 15:39:27 +0000 (08:39 -0700)
commitca6a5545ba18844a97c88a90a385eb6335bb7526
treea6a82ccbde9c57045bd0b77797944502ab3184a3
parent3a666bca00d7fb30d55e252131ea2cf2006dc3a3
[release-branch.go1.24] crypto/x509: rework fix for CVE-2025-58187

In CL 709854 we enabled strict validation for a number of properties of
domain names (and their constraints). This caused significant breakage,
since we didn't previously disallow the creation of certificates which
contained these malformed domains.

Rollback a number of the properties we enforced, making domainNameValid
only enforce the same properties that domainToReverseLabels does. Since
this also undoes some of the DoS protections our initial fix enabled,
this change also adds caching of constraints in isValid (which perhaps
is the fix we should've initially chosen).

Updates #75835
Updates #75828
Fixes #75860

Change-Id: Ie6ca6b4f30e9b8a143692b64757f7bbf4671ed0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/710735
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
(cherry picked from commit 1cd71689f2ed8f07031a0cc58fc3586ca501839f)
Reviewed-on: https://go-review.googlesource.com/c/go/+/710879
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
src/crypto/x509/name_constraints_test.go
src/crypto/x509/parser.go
src/crypto/x509/parser_test.go
src/crypto/x509/verify.go
src/crypto/x509/verify_test.go