Skip to main content
← All vulnerabilities
CVE-2026-78661GO-2026-6860EUVD-2026-111399GHSA-75PG-WVH3-34JR

Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 0.62.0
None on Exploit-DB, Metasploit or GitHub

Summary

The golang.org/x/net HTML parser, which Go programs use to parse HTML documents, is affected. Crafted HTML containing many short text fragments separated by ignored end tags can cause parsing time and memory use to grow quadratically, potentially slowing or exhausting resources on the system doing the parsing.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original description

When coalescing adjacent text nodes in addText and fosterParent, appending to an existing TextNode's Data via string concatenation (n.Data += text) reallocated and copied the accumulated string on every token. Inputs containing many short text runs separated by ignored end tags (such as "a</x>") caused O(n^2) allocations and byte copies. Accumulate coalesced text in per-node byte slices during parsing and materialize Data strings once at the end of parse.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • golang.org/x/net/html

    fixed in 0.62.0

  • golang.org/x/netGo

    fixed in 0.62.0

References 4

go.dev

groups.google.com

pkg.go.dev