CVE-2025-61729: Excessive Resource Consumption in Go's stdlib crypto/x509 Package

stdlib Updated 02 Dec 2025

Summary

02/12/2025
Yes i
Unrated
Not published

CVE-2025-61729: Within HostnameError.Error(), when constructing an error string, there is no limit to the number of hosts that will be printed out. Affects stdlib across 2 version ranges.

< 1.24.11 >= 1.25.0, < 1.25.5

Fixed in 1.24.11 or 1.25.5, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2025-61729 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Go programming language's standard library (stdlib) includes a package called crypto/x509, which is responsible for handling X.509 certificates. These certificates are widely used for secure communications over networks. The package provides functionalities for parsing, validating, and managing certificates. However, it has a vulnerability that can lead to excessive resource consumption when handling error strings during host certificate validation.

Vulnerability Detail

The vulnerability arises within the HostnameError.Error() method, where there is no limit to the number of hosts printed in the error string. This can lead to a situation where a certificate from a malicious actor causes the application to consume excessive resources due to repeated string concatenation, resulting in quadratic runtime complexity. This can potentially lead to denial of service (DoS) conditions, affecting the performance and availability of applications relying on this package.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.24.11 1.24.11
    go get stdlib@v1.24.11
  • >= 1.25.0, < 1.25.5 1.25.5
    go get stdlib@v1.25.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

Currently, there are no specific workarounds mentioned for this vulnerability. However, it is advisable to validate and sanitize input certificates to mitigate potential risks until the package is updated.

Conclusion

CVE-2025-61729 represents a significant vulnerability in the Go standard library's crypto/x509 package, leading to excessive resource consumption. It is crucial for developers to update to the patched versions to protect their applications from potential denial of service attacks. Regular monitoring of dependencies using tools like Vulert can help maintain security.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

CVE-2025-61729 is a vulnerability in the Go standard library's crypto/x509 package that can lead to excessive resource consumption when printing error strings for host certificate validation.

If your application uses the affected version of the crypto/x509 package, it may be susceptible to denial of service attacks due to excessive resource consumption when processing certain certificates.

The vulnerability affects Go versions prior to 1.24.11 and 1.25.5. Ensure you are using one of the patched versions to avoid this issue.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

While there are no specific workarounds, consider validating and sanitizing input certificates to reduce the risk of exploitation until you can update to a patched version.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.24.11 1.24.11
    go get stdlib@v1.24.11
  • >= 1.25.0, < 1.25.5 1.25.5
    go get stdlib@v1.25.5

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback