deps(c#): Update dependency AngleSharp to 1.5.0 [SECURITY]#221
Open
renovate[bot] wants to merge 1 commit into
Open
deps(c#): Update dependency AngleSharp to 1.5.0 [SECURITY]#221renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.4.0→1.5.0AngleSharp HTML5 Spec Compliance: mXSS via annotation-xml HTML Integration Point Bypass
CVE-2026-54570 / GHSA-pgww-w46g-26qg
More information
Details
Summary
The HTML specification requires that a MathML
<annotation-xml>element withencoding="text/html"orencoding="application/xhtml+xml"is treated as an HTML integration point. Content inside it must be parsed as HTML, not MathML.AngleSharp does not implement this correctly. As a result, the parser produces a DOM tree that differs from what a browser will build (different namespaces if
encoding="text/html"is not treated) when given the same serialized output. Two bugs combine to make this exploitable:Details
In
MathAnnotationXmlElement(AngleSharp/Mathml/Dom/Internal/MathAnnotationXmlElement.cs):Because
HtmlTipis absent, the token dispatch inConsume()always sends tokens toForeign()when insideannotation-xml, regardless of the encoding attribute. The compensating check inForeignNormalTag()only covers tags inAllForeignExceptionsand is entirely bypassed during fragment parsing (innerHTMLsetter) due to anif (!IsFragmentCase)guard.In
HtmlMarkupFormatter.WriteAttributeValue()(AngleSharp/Html/HtmlMarkupFormatter.cs):PoC
The following program demonstrates that AngleSharp’s parser misses the injected
<img>element. A sanitizer walking this DOM would see nothing dangerous, yet the serialized output re-parses in a browser as a live<img onerror>trigger.Output:
The
titletag may be swapped out forstyleand other RCDATA elements.When a browser receives this string and parses
annotation-xml encoding="text/html"as an HTML integration point, the</title>closes the title element and the<img>fires its onerror handler.Impact
Implemented HTML sanitizers that depend and trust AngleSharp's ability to parse HTML correctly may be bypassable, as AngleSharp fails to acknowledge certain vectors under certain conditions.
This reduces AngleSharp's credibility as a conformant HTML parser.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
AngleSharp/AngleSharp (AngleSharp)
v1.5.0Released on Saturday, June 6 2026
MemoryCookieProvider(#1249) @riinaConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.