CVE-2026-142223: AngleSharp before 1.8.6 Mutation XSS via HtmlMarkupFormatter Attribute Serialization
AngleSharp before 1.8.6 contains a mutation cross-site scripting vulnerability in HtmlMarkupFormatter.WriteAttributeValue, which writes less-than and greater-than characters unescaped in serialized attribute values. Attackers can embed </noscript> followed by an img element with an onerror handler in a noscript child attribute, executing script when browsers parse the re-serialized output.
Affected Software
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using AngleSharp before version 1.8.6 are affected when they serialize HTML with HtmlMarkupFormatter and later provide that re-serialized output to a browser for parsing. The vulnerable path involves attribute values on a noscript child element.
What does an attacker need to exploit it?
An attacker needs a way to embed crafted HTML into content that the application processes and re-serializes with the affected formatter. The payload uses a closing noscript tag followed by an img element with an onerror handler, and exploitation requires a browser to parse the resulting output.
Is user interaction required?
Yes. The supplied vector specifies UI:R, meaning a user must interact with or view content that causes the browser to parse the malicious re-serialized HTML.
What should be done if immediate patching is not possible?
The provided data does not identify a workaround. Avoid re-serializing untrusted HTML with HtmlMarkupFormatter or prevent untrusted content from reaching the affected attribute-serialization path until upgrading to 1.8.6 or later.