Inefficient candidate hostname parsing in crypto/x509 (Go standard library crypto/x509)

CVE-2026-27145
MEDIUM 6.5

At a glance

Source
NVD
EPSS
EPSS 0.59 % · percentile 48 ()
State
PUBLISHED
Published
Updated
Assigner
Go
NVD status
Awaiting Analysis

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.

Weaknesses (CWE)

  • CWE-606 — Unchecked Input for Loop Condition

References

Scores

VersionScoreVectorScored by
CVSS 3.1MEDIUM 6.5CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:HCISA-ADP
CVSS 3.1HIGH 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:Hredhat-SADP
CVSS 3.1MEDIUM 6.5CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:HNVD · 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary)
CVSS 3.1HIGH 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HNVD · 0b0ca135-0b70-47e7-9f44-1890c2a1c46c (Secondary)

Advisories

European references

CERT-FR advisories

Affected products

ProductVersions
Go standard library · crypto/x509affected 0 < 1.25.11 ; affected 1.26.0-0 < 1.26.4

Sources

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
CERT-FR (ANSSI)Licence Ouverte / Etalab 2.0
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD