Inefficient candidate hostname parsing in crypto/x509
Summary
| CVE | CVE-2026-27145 |
|---|---|
| State | PUBLISHED |
| Assigner | Go |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-06-02 23:16:35 UTC |
| Updated | 2026-06-02 23:16:35 UTC |
| Description | (*x509.Certificate).VerifyHostname previously called matchHostnames in a loop over all DNS Subject Alternative Name (SAN) entries. This caused strings.Split(host, ".") to execute repeatedly on the same input hostname. With a large DNS SAN list, verification costs scaled quadratically based on the number of SAN entries multiplied by the hostname's label count. Because x509.Verify validates hostnames before building the certificate chain, this overhead occurred even for untrusted certificates. |
Risk And Classification
Problem Types: CWE-407: Inefficient Algorithmic Complexity
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Go Standard Library | Crypto/x509 | affected 1.25.11 semver | Not specified |
| CNA | Go Standard Library | Crypto/x509 | affected 1.26.0-0 1.26.4 semver | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| go.dev/cl/783621 | [email protected] | go.dev | |
| pkg.go.dev/vuln/GO-2026-5037 | [email protected] | pkg.go.dev | |
| go.dev/issue/79694 | [email protected] | go.dev | |
| groups.google.com/g/golang-announce/c/tKs3rmcBcKw | [email protected] | groups.google.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: Jakub Ciolek - https://ciolek.dev/ (en)
There are currently no legacy QID mappings associated with this CVE.