{"id":"CVE-2026-78661","revision":"d7ffc9a7a05849bf9d83d1e92bf358cb","records":[{"revision":"d7ffc9a7a05849bf9d83d1e92bf358cb","observedAt":"2026-10-27T22:45:55.385+00:00","statement":{"source":"cve-program","id":"CVE-2026-78661","aliases":[],"title":"Avoid quadratic complexity when coalescing text nodes in html in golang.org/x/net","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.","state":0,"publishedAt":"2026-10-27T21:38:56.517+00:00","modifiedAt":"2026-10-27T21:38:56.517+00:00","affected":[{"ecosystem":"https://pkg.go.dev","name":"golang.org/x/net/html","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"golang.org/x/net\",\n                    \"product\": \"golang.org/x/net/html\",\n                    \"collectionURL\": \"https://pkg.go.dev\",\n                    \"packageName\": \"golang.org/x/net/html\",\n                    \"versions\": [\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"0.62.0\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"semver\"\n                        }\n                    ],\n                    \"programRoutines\": [\n                        {\n                            \"name\": \"parser.addText\"\n                        },\n                        {\n                            \"name\": \"parser.fosterParent\"\n                        },\n                        {\n                            \"name\": \"parser.parse\"\n                        },\n                        {\n                            \"name\": \"Parse\"\n                        },\n                        {\n                            \"name\": \"ParseFragment\"\n                        },\n                        {\n                            \"name\": \"ParseFragmentWithOptions\"\n                        },\n                        {\n                            \"name\": \"ParseWithOptions\"\n                        }\n                    ],\n                    \"defaultStatus\": \"unaffected\"\n                }"}],"metrics":[],"references":["https://go.dev/cl/849365","https://go.dev/issue/82224","https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs","https://pkg.go.dev/vuln/GO-2026-6860"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-78661","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-78661","identifiers":["CVE-2026-78661"]},"retained":false,"historicalAffected":[]}],"coverage":[]}