Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net
Summary
| CVE | CVE-2026-78661 |
|---|---|
| State | PUBLISHED |
| Assigner | Go |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-10-27 22:18:05 UTC |
| Updated | 2026-11-04 17:17:37 UTC |
| 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. |
Risk And Classification
Primary CVSS: v3.1 7.5 HIGH from ADP
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS: 0.001850000 probability, percentile 0.081360000 (date 2026-11-04)
Problem Types: CWE-407 | CWE-407: Inefficient Algorithmic Complexity | CWE-407 CWE-407 Inefficient Algorithmic Complexity
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | ADP | DECLARED | 7.5 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| 3.1 | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | Secondary | 7.5 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
LowPrivileges Required
NoneUser Interaction
NoneScope
UnchangedConfidentiality
HighIntegrity
NoneAvailability
NoneCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Golang.orgxnet | Golang.org/x/net/html | affected 0.62.0 semver | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| groups.google.com/g/golang-announce/c/sqrs2vTx_Xs | [email protected] | groups.google.com | |
| go.dev/cl/849365 | [email protected] | go.dev | |
| go.dev/issue/82224 | [email protected] | go.dev | |
| pkg.go.dev/vuln/GO-2026-6860 | [email protected] | pkg.go.dev | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: Markus Magnuson (en)
There are currently no legacy QID mappings associated with this CVE.