{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-78661","assignerOrgId":"1bb62c36-49e3-4200-9d77-64a1400537cc","state":"PUBLISHED","assignerShortName":"Go","dateReserved":"2026-08-24T23:36:15.738Z","datePublished":"2026-10-27T21:38:56.517Z","dateUpdated":"2026-10-27T21:38:56.517Z"},"containers":{"cna":{"providerMetadata":{"orgId":"1bb62c36-49e3-4200-9d77-64a1400537cc","shortName":"Go","dateUpdated":"2026-10-27T21:38:56.517Z"},"title":"Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net","descriptions":[{"lang":"en","value":"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":[{"vendor":"golang.org/x/net","product":"golang.org/x/net/html","collectionURL":"https://pkg.go.dev","packageName":"golang.org/x/net/html","versions":[{"version":"0","lessThan":"0.62.0","status":"affected","versionType":"semver"}],"programRoutines":[{"name":"parser.addText"},{"name":"parser.fosterParent"},{"name":"parser.parse"},{"name":"Parse"},{"name":"ParseFragment"},{"name":"ParseFragmentWithOptions"},{"name":"ParseWithOptions"}],"defaultStatus":"unaffected"}],"problemTypes":[{"descriptions":[{"lang":"en","description":"CWE-407: Inefficient Algorithmic Complexity"}]}],"references":[{"url":"https://go.dev/cl/849365"},{"url":"https://go.dev/issue/82224"},{"url":"https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs"},{"url":"https://pkg.go.dev/vuln/GO-2026-6860"}],"credits":[{"lang":"en","value":"Markus Magnuson"}]}}}