]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.25] 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:57:00 +0000 (08:57 -0700)
commite05b2c92d973ecf5a8042fd9605501b842e18369
treeb66aac038032ec37a12db725938fa3d411ec5c3b
parent79ec0c94f32b0fedd0a4e9aacbe0b305b2a66762
[release-branch.go1.25] 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 #75861

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/+/710677
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: 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