CVE-2026-78661

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

Published Oct 27, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-407
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Golang
Golang net
Vendors & Products Golang
Golang net
Type Values Removed Values Added
Weaknesses CWE-770
Type Values Removed Values Added
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.
Title Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Go
Published
Updated
Nov 4, 2026, 4:40 PM
Reserved
Aug 24, 2026, 11:36 PM
Status
Deferred
Published
Oct 27, 2026, 10:18 PM
Modified
Nov 4, 2026, 5:17 PM