CVE-2026-42504: Google Go CPU exhaustion in mime WordDecoder.DecodeHeader

CVE-2026-42504 · Severity: info · CVSS 0 · Published 2026-06-02

A vulnerability in the Go programming language's standard library can allow an attacker to cause a denial-of-service condition. By sending a specially crafted email or web header, an attacker can force the application to consume excessive processor power, potentially slowing down or crashing the service. This affects any Go-based application that processes MIME headers, such as mail servers or web applications.

Technologies: stdlib (Go). Vendors: Go.

Quick answers

Is CVE-2026-42504 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-42504 being exploited in the wild.
How severe is CVE-2026-42504?
Informational severity, with a CVSS score of 0, published 2 June 2026.
Which products and versions are affected?
stdlib (Go) SEMVER:introduced=0,fixed=1.25.11,introduced=1.26.0-0,fixed=1.26.4.
Is there a fix for CVE-2026-42504?
Yes. stdlib (Go): upgrade to 1.26.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-42504 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-42504?
Check whether you run stdlib (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • stdlib (Go): upgrade to 1.26.4 or later
    go get stdlib@v1.26.4

Technical details

A vulnerability exists in the 'mime' package's WordDecoder.DecodeHeader function due to quadratic complexity when handling invalid encoded-words. When the decoder encounters an invalid encoded-word, it consumes only the initial '=?' prefix and resumes parsing from that point. An attacker can exploit this by providing a header with many nested or repeated '=?' prefixes followed by a single terminal '?=', causing the decoder to repeatedly re-scan the input. This leads to excessive CPU consumption (Denial of Service). The issue is fixed in Go versions 1.25.11 and 1.26.4.

Affected products

  • Google Go before 1.25.11, 1.26.0 before 1.26.4

Identifiers

  • CVE-2026-42504
  • GO-2026-5038

Timeline

  • 2026-05-05: disclosed: Issue opened on Go GitHub repository
  • 2026-06-02: advisory: CVE-2026-42504 published
  • 2026-06-02: patched: Fixed in Go 1.25.11 and 1.26.4

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.