{"id":"GO-2026-6860","summary":"Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net","details":"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\u003c/x\u003e\") caused O(n^2) allocations and byte copies.\n\nAccumulate coalesced text in per-node byte slices during parsing and materialize Data strings once at the end of parse.","aliases":["CVE-2026-78661"],"modified":"2026-10-27T21:30:04.890809062Z","published":"2026-10-27T21:16:18Z","database_specific":{"url":"https://pkg.go.dev/vuln/GO-2026-6860","review_status":"REVIEWED"},"references":[{"type":"FIX","url":"https://go.dev/cl/849365"},{"type":"REPORT","url":"https://go.dev/issue/82224"},{"type":"WEB","url":"https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs"}],"affected":[{"package":{"name":"golang.org/x/net","ecosystem":"Go","purl":"pkg:golang/golang.org/x/net"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.62.0"}]}],"ecosystem_specific":{"imports":[{"symbols":["Parse","ParseFragment","ParseFragmentWithOptions","ParseWithOptions","parser.addText","parser.fosterParent","parser.parse"],"path":"golang.org/x/net/html"}]},"database_specific":{"source":"https://vuln.go.dev/ID/GO-2026-6860.json"}}],"schema_version":"1.9.2","credits":[{"name":"Markus Magnuson"}]}