crypto/x509: Certificate parsing/verification supports non-compliant dNSName constraints #37535
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
crypto/x509
supports dNSName name constraints which contain a leading period (i.e..example.com
), which are only valid for URIs per RFC 5280 (a comment inmatchDomainConstraint
notes this, but implements it anyway). Per #16347 this seems to have mainly been implemented to maintain compatibility with OpenSSL and NSS, which allow these malformed constraints.The current behavior in
Certificate.Verify
matches validation of URI constraints, requiring one or more labels to be appended to the name when a leading period is present. Given this is unspecified behavior, per 5280, this should be at least documented somewhere. Depending on the efforts to clarify this behavior (see https://www.rfc-editor.org/errata/eid5997) it may make sense to deprecate support for these constraints altogether (while I'm not sure about prevalence of this misuse in internal PKIs, these constraints are not allowed in the public web PKI).The text was updated successfully, but these errors were encountered: