CVE-2026-78661
7.5high
Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net
- Severity
- 7.5high CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.48% (higher than 43% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Go
- Also known as
- GO-2026-6860
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| golang.org/x/net/html | before 0.62.0 | CVE List |
| golang.org/x/net (Go) | before 0.62.0 | Go Vulnerability Database |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-78661 changed 2026-11-04 | CVE Terms of Use |
| Go Vulnerability Database | GO-2026-6860 changed 2026-10-27 | CC-BY-4.0 |
| NVD | CVE-2026-78661 changed 2026-11-04 | Public domain |