
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-54570 is a mutation XSS (mXSS) vulnerability in AngleSharp, a .NET HTML5 parsing library, caused by incorrect handling of the MathML <annotation-xml> HTML integration point. Two compounding bugs allow an attacker to craft input that AngleSharp's parser treats as safe, but which a browser re-parses as executable script. It affects all AngleSharp NuGet versions prior to 1.5.0 (specifically ≤ 1.4.1). The vulnerability was first published by maintainer FlorianRappl on June 6, 2026, and added to the GitHub Advisory Database on July 17, 2026. It carries a CVSS v3.1 base score of 6.9 (Medium) (GitHub Advisory, AngleSharp Advisory).
The vulnerability is classified as CWE-80 (Improper Neutralization of Script-Related HTML Tags in a Web Page). Two distinct bugs combine to enable exploitation: (1) MathAnnotationXmlElement is never assigned the NodeFlags.HtmlTip flag based on its encoding attribute, so the parser's Consume() dispatch always routes tokens to Foreign() (MathML mode) instead of Home() (HTML mode), even when encoding="text/html" or encoding="application/xhtml+xml" is present — violating the HTML specification's requirement to treat such elements as HTML integration points; (2) HtmlMarkupFormatter.WriteAttributeValue() escapes &, ", and non-breaking spaces but does not escape < or > in attribute values, allowing injected markup to break out of attribute context during re-serialization. The compensating check in ForeignNormalTag() is also bypassed entirely during fragment parsing (the innerHTML setter) due to an if (!IsFragmentCase) guard. A public proof-of-concept is included in the advisory, demonstrating that a sanitizer walking AngleSharp's DOM sees no dangerous elements, yet the serialized output triggers script execution when re-parsed by a browser (GitHub Advisory, AngleSharp Advisory).
The primary impact is a bypass of HTML sanitizers that rely on AngleSharp for safe HTML parsing. An attacker can supply crafted input containing a MathML <annotation-xml encoding="text/html"> payload with unescaped </> in attribute values; AngleSharp's DOM will appear clean to a sanitizer, but the serialized output — when rendered by a browser — will execute arbitrary JavaScript (e.g., via <img onerror=...> or similar event handlers). This enables cross-site scripting (XSS) attacks against end users of applications that use AngleSharp-based sanitization, with potential for session hijacking, credential theft, and unauthorized actions performed in the victim's browser context. The scope is changed (attacker impacts resources beyond the vulnerable component), confidentiality impact is low, and integrity impact is high (GitHub Advisory).
<annotation-xml encoding="text/html"> element containing an attribute value with unescaped < and > characters, embedding a script-triggering element such as <img onerror=alert(1)> inside the attribute value.<img> element (it is hidden inside an attribute value in MathML namespace), so the sanitizer finds nothing dangerous and passes the content.< and > are not escaped in attribute values, the output string contains raw markup that breaks out of the attribute context.annotation-xml encoding="text/html" as an HTML integration point, causing the injected element (e.g., <img onerror=...>) to be instantiated and the event handler to execute arbitrary JavaScript (GitHub Advisory, AngleSharp Advisory).annotation-xml elements with encoding="text/html" or encoding="application/xhtml+xml" attributes in POST body or URL parameters; responses containing raw unescaped < or > characters inside HTML attribute values in rendered content.<annotation-xml or <math tags from user input fields; server-side HTML sanitization logs (if present) showing content passed as clean that contains MathML structures.onerror, onload, or similar event handlers on image or other elements in pages that display user-generated content.<annotation-xml with encoding="text/html" alongside attribute values with raw </> characters.Upgrade AngleSharp (NuGet package) to version 1.5.0 or later, which fixes the vulnerability by correctly assigning NodeFlags.HtmlTip to MathAnnotationXmlElement based on its encoding attribute and by escaping < and > in HtmlMarkupFormatter.WriteAttributeValue(). No configuration-based workaround is available for the parser bug itself; applications that cannot upgrade immediately should consider using an alternative HTML sanitization library or adding a secondary validation layer that rejects input containing <annotation-xml with HTML-encoding attributes. Developers using AngleSharp as a sanitization backend should treat its output as untrusted until upgraded (AngleSharp Release 1.5.0, GitHub Advisory).
The vulnerability was reported by security researcher internetpestcontrol and published by AngleSharp maintainer FlorianRappl on June 6, 2026. The advisory was added to the GitHub Advisory Database on July 17, 2026. No significant broader media coverage or notable social media discussion has been identified at this time (GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."