Skip to content

crypto/x509: excessive resource consumption in printing error string for host certificate validation (CVE-2025-61729) #76445

@nicholashusin

Description

@nicholashusin

Within HostnameError.Error(), when constructing an error string, there is no limit to the number of hosts that will be printed out.
Furthermore, the error string is constructed by repeated string concatenation, leading to quadratic runtime.

Therefore, a certificate provided by a malicious actor can result in excessive resource consumption.
HostnameError.Error() now limits the number of hosts and utilizes strings.Builder when constructing an error string.

Thanks to Philippe Antoine (Catena cyber) for reporting this issue.

This is CVE-2025-61729 and Go issue #76445 (this one).


This is a PRIVATE issue for CVE-2025-61729, tracked in http://b/450936127 and fixed by https://go-internal-review.git.corp.google.com/c/go/+/3000.

/cc @golang/security and @golang/release

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.Securityrelease-blockervulncheck or vulndbIssues for the x/vuln or x/vulndb repo

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions