freenode
Languages & Toolchains

Go x509 email constraints mishandle subdomains, CVE-2026-78664

RFC 5280 rfc822Name rules differ from DNS matching; Go applied the wrong model and is treating the bug as a public security issue.

Go's crypto/x509 package incorrectly enforces email address name constraints from RFC 5280, applying DNS-style subdomain logic where the standard requires different rules. The defect is tracked as CVE-2026-78664.

Certificate name constraints limit which names a CA may certify. For email addresses (rfc822Name), a constraint of "example.com" is meant to cover mailboxes on that host only, not on subdomains, while a leading-dot form such as ".example.com" covers subdomains and not the bare domain. Go instead treated the domain portion of email constraints the same way it treats dNSName constraints, so subdomain matching did not follow the RFC.

Name constraints are rarely used in practice. The Go project is therefore handling the report on its public security track. Jack Lloyd first reported the issue.