# CVE-2026-78661: Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net

- Severity: High 7.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.48%, higher than 43% of CVEs (2026-12-01)
- Published: 2026-10-27T21:16:18.000Z
- Modified: 2026-11-04T17:17:37.673Z
- Also known as: GO-2026-6860
- Weaknesses: CWE-407
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: Go

## 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.

(As written by CVE List.)

## Affected

- golang.org/x/net/html: before 0.62.0
- golang.org/x/net (Go): before 0.62.0

## References

- <https://go.dev/cl/849365> (fix)
- <https://go.dev/issue/82224> (report)
- <https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs> (web)
- <https://pkg.go.dev/vuln/GO-2026-6860>

## Sources

- CVE List: [CVE-2026-78661](https://www.cve.org/CVERecord?id=CVE-2026-78661), CVE Terms of Use, modified 2026-11-04
- Go Vulnerability Database: [GO-2026-6860](https://pkg.go.dev/vuln/GO-2026-6860), CC-BY-4.0, modified 2026-10-27
- NVD: [CVE-2026-78661](https://nvd.nist.gov/vuln/detail/CVE-2026-78661), Public domain, modified 2026-11-04

---

Page: https://cve.day/CVE-2026-78661 · Whole record: https://cve.day/CVE-2026-78661.json · Rebuilt by cve.day 2026-11-25T22:59:47.465Z
