You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
crypto/x509: reject unsupported bounds in critical name constraints #81499
The name constraints parser ignores the contents of each GeneralSubtree after its base name, including minimum and maximum fields, and treats the critical extension as handled. As a result, verification can accept a chain with unsupported subtree bounds instead of processing those bounds or rejecting the certificate as required by RFC 5280.
Details
In src/crypto/x509/parser.go, parseNameConstraintsExtension reads a GeneralSubtree SEQUENCE and its first element but does not consume or check the remaining seq. processExtensions then considers the extension handled, and chain constraint checks operate only on the parsed base names.
A reproducer uses an Ed25519 root, intermediate, and leaf, with this critical nameConstraints extension (OID 2.5.29.30) on the intermediate:
Give the leaf the DNS SAN www.example.com, trust the root, supply the intermediate, and call leaf.Verify with that DNS name and a time within all certificates' validity intervals. UnhandledCriticalExtensions is empty and verification returns nil, despite the unsupported maximum bound.
RFC 5280 §4.2.1.10 requires minimum zero and maximum absent within the profile. For a critical extension with other bounds on a name form used later in the path, an implementation must process the bounds or reject the certificate.
This issue was found by zkao and was triaged by @FiloSottile as a valid bug but not a vulnerability. /cc @golang/security
Activity
gabyhelp commentedon Sep 13, 2026
Related Issues
Related Code Changes
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
gopherbot commentedon Sep 20, 2026
Change https://go.dev/cl/835685 mentions this issue:
crypto/x509: reject unsupported bounds in critical name constraints