CVE-2025-61729 Excessive resource consumption when printing error string for host certificate validation in crypto/x509
A malicious certificate can cause excessive resource consumption in Go's crypto/x509 package during error string generation, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-61729?
CVE-2025-61729 is a high-severity denial of service vulnerability in Golang Go, published on 2 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-295
Which versions are affected by CVE-2025-61729?
2 open source packages ship an affected version, including golang and stdlib. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
golang Bitnami | All versions | 1.24.11, 1.25.5 |
stdlib Go | All versions | 1.24.11, 1.25.5 |
Linux distribution packages (38)
golang-docs AlmaLinux:10 | All versions | 1.25.5-1.el10_1.alma.1 |
golang-misc AlmaLinux:10 | All versions | 1.25.5-1.el10_1.alma.1 |
golang-src AlmaLinux:10 | All versions | 1.25.5-1.el10_1.alma.1 |
golang-tests AlmaLinux:10 | All versions | 1.25.5-1.el10_1.alma.1 |
ipp-usb AlmaLinux:10 | All versions | 0.9.27-4.el10_1 |
opentelemetry-collector AlmaLinux:10 | All versions | 0.135.0-3.el10_1 |
delve AlmaLinux:8 | All versions | 1.25.2-1.module_el8.10.0+4074+24330916 |
git-lfs AlmaLinux:8 | All versions | 3.4.1-7.el8_10 |
go-toolset AlmaLinux:8 | All versions | 1.25.5-1.module_el8.10.0+4107+b32a33ce |
golang AlmaLinux:8 | All versions | 1.25.5-1.module_el8.10.0+4107+b32a33ce |
golang-bin AlmaLinux:8 | All versions | 1.25.5-1.module_el8.10.0+4107+b32a33ce |
golang-docs AlmaLinux:8 | All versions | 1.25.5-1.module_el8.10.0+4107+b32a33ce |
golang-misc AlmaLinux:8 | All versions | 1.25.5-1.module_el8.10.0+4107+b32a33ce |
golang-race AlmaLinux:8 | All versions | 1.25.5-1.module_el8.10.0+4107+b32a33ce |
golang-src AlmaLinux:8 | All versions | 1.25.5-1.module_el8.10.0+4107+b32a33ce |
golang-tests AlmaLinux:8 | All versions | 1.25.5-1.module_el8.10.0+4107+b32a33ce |
grafana AlmaLinux:8 | All versions | 9.2.10-27.el8_10 |
grafana-pcp AlmaLinux:8 | All versions | 5.1.1-11.el8_10 |
grafana-selinux AlmaLinux:8 | All versions | 9.2.10-27.el8_10 |
osbuild-composer AlmaLinux:8 | All versions | 101.4-3.el8_10.alma.1 |
osbuild-composer-core AlmaLinux:8 | All versions | 101.4-3.el8_10.alma.1 |
osbuild-composer-worker AlmaLinux:8 | All versions | 101.4-3.el8_10.alma.1 |
go-toolset AlmaLinux:9 | All versions | 1.25.5-2.el9_7 |
golang AlmaLinux:9 | All versions | 1.25.5-2.el9_7 |
golang-bin AlmaLinux:9 | All versions | 1.25.5-2.el9_7 |
golang-docs AlmaLinux:9 | All versions | 1.25.5-2.el9_7 |
golang-misc AlmaLinux:9 | All versions | 1.25.5-2.el9_7 |
golang-race AlmaLinux:9 | All versions | 1.25.5-2.el9_7 |
golang-src AlmaLinux:9 | All versions | 1.25.5-2.el9_7 |
golang-tests AlmaLinux:9 | All versions | 1.25.5-2.el9_7 |
opentelemetry-collector AlmaLinux:9 | All versions | 0.135.0-3.el9_7 |
go-toolset Red Hat:enterprise_linux:10.1 | All versions | 0:1.25.5-1.el10_1 |
golang Red Hat:enterprise_linux:10.1 | All versions | 0:1.25.5-1.el10_1 |
golang-bin Red Hat:enterprise_linux:10.1 | All versions | 0:1.25.5-1.el10_1 |
golang-docs Red Hat:enterprise_linux:10.1 | All versions | 0:1.25.5-1.el10_1 |
golang-misc Red Hat:enterprise_linux:10.1 | All versions | 0:1.25.5-1.el10_1 |
golang-race Red Hat:enterprise_linux:10.1 | All versions | 0:1.25.5-1.el10_1 |
golang-src Red Hat:enterprise_linux:10.1 | All versions | 0:1.25.5-1.el10_1 |
Products include Golang Go.
How do I fix CVE-2025-61729?
Upgrade golang to a fixed version for your release line: 1.24.11 or 1.25.5.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2025-61729 being exploited?
There is no known exploitation of CVE-2025-61729 in the wild and no public exploit code.
Other vulnerabilities in Golang Go
- CVE-2020-0601 Microsoft Windows CryptoAPI Spoofing
- CVE-2026-27143 Missing bound checks can lead to memory corruption in safe Go in cmd/compile
- CVE-2024-24790 Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip
- CVE-2023-39320 Arbitrary code execution via go.mod toolchain directive in cmd/go
- CVE-2023-24540 Improper handling of JavaScript whitespace in html/template
Sources
Also known as ALSA-2026:0921, ALSA-2026:0922, ALSA-2026:0923, ALSA-2026:1344, ALSA-2026:1518, ALSA-2026:1715 and 420 more.