---
id: CVE-2025-61729
aliases:
  - GO-2025-4155
  - BIT-golang-2025-61729
title: >-
  Excessive resource consumption when printing error string for host certificate
  validation in crypto/x509
summary: >-
  Excessive resource consumption when printing error string for host certificate
  validation in crypto/x509
severity: none
vendor: stdlib
product: stdlib
ecosystem: go
affected:
  - 'stdlib >= 1.25.0, < 1.25.5'
patched:
  - stdlib 1.25.5
published: '2025-12-02'
updated: '2026-07-09'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GO-2025-4155'
references:
  - url: 'https://go.dev/cl/725920'
  - url: 'https://go.dev/issue/76445'
  - url: 'https://groups.google.com/g/golang-announce/c/8FJoBkPddm4'
tags:
  - osv
  - go
epss: 0.00457
epssPercentile: 0.36906
ingestedAt: '2026-07-09T18:56:37.014Z'
---

## Overview

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.

## Affected packages

- `stdlib >= 1.25.0, < 1.25.5`

## Remediation

Upgrade to a patched release:

- `stdlib 1.25.5`
