Update dependency HtmlSanitizer to v9 [SECURITY]#111
Open
renovate[bot] wants to merge 1 commit intomasterfrom
Open
Update dependency HtmlSanitizer to v9 [SECURITY]#111renovate[bot] wants to merge 1 commit intomasterfrom
renovate[bot] wants to merge 1 commit intomasterfrom
Conversation
b69e121 to
6e1d663
Compare
6e1d663 to
f5ae138
Compare
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:
8.0.645→9.0.892GitHub Vulnerability Alerts
CVE-2023-44390
Impact
The vulnerability occurs in configurations where foreign content is allowed, i.e. either
svgormathare in the list of allowed elements.Specifically, the requirements for the vulnerability are:
svg, ormathiframe,noembed,xmp,title,noframes,styleornoscriptConfigurations that meet the above requirements plus the following are vulnerable to an additional vulnerability:
title,desc,mi,mo,mn,ms,mtext,annotation-xml.In case an application sanitizes user input with a vulnerable configuration, an attacker could
bypass the sanitization and inject arbitrary HTML, including JavaScript code.
Note that in the default configuration the vulnerability is not present.
Patches
The vulnerability has been fixed in versions 8.0.723 and 8.1.722-beta (preview version).
Workarounds
Disallow foreign elements
svgandmath. This is the case in the default configuration, which is therefore not affected by the vulnerability.CVE-2026-25543
Impact
If the
templatetag is allowed, its contents are not sanitized. Thetemplatetag is a special tag that does not usually render its contents, unless theshadowrootmodeattribute is set toopenorclosed.The lack of sanitization of the template tag brings up two bypasses:
<template>tag through mutation XSS. The DOM parsers in browsers such as Chromium have a node depth limit of 512 and tags which are beyond that depth are flattened. This in turn allows elements within<template>(which are not sanitized) to be effectively 'popped out'. An example would look like this:<div>[...]<template><script>alert('xss')</script>where[...]denotes at least another 509 opening<div>tags.shadowrootmodeattribute is allowed throughsanitizer.AllowedAttributes.Add("shadowrootmode");, the simple payload of<div><template shadowrootmode="open"><script>alert('xss')</script>would bypass the sanitizer. This is because such usage of<template>attaches a shadow root to its parent:<div>, and its contents will be rendered.Note that the default configuration is not affected because the
templatetag is disallowed by default.Patches
The problem has been patched in versions 9.0.892 and 9.1.893-beta.
Workarounds
Disallow the
templatetag. It is disallowed by default.Resources
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template
Release Notes
mganss/HtmlSanitizer (HtmlSanitizer)
v9.0.892: 9.0.892Sanitize contents of template tag
v9.0.889: 9.0.889Update NuGet packages
v9.0.886: 9.0.886Target net47 (fixes #580)
v9.0.884: 9.0.884#574
v9.0.881: 9.0.881#572
#573
v9.0.876: 9.0.876#565
v9.0.873: 9.0.873Add FilterUrl to IHtmlSanitizer (fixes #565)
v8.1.870: 8.1.870#556
v8.0.865: 8.0.865#542
v8.0.843: 8.0.843Add package README file
v8.0.838: 8.0.838Create customizable comment encoding method (fixes #525)
v8.0.811: 8.0.811Merge pull request #516 from jerriep/allow-overriding-literal-text-element-encoding
v8.0.795: 8.0.795See #494
v8.0.746: 8.0.746Fix #483
v8.0.744: 8.0.744Fix #483
v8.0.723: 8.0.723Fix for GHSA-43cp-6p3q-2pc4
v8.0.718: 8.0.718Fix #469
v8.0.692: 8.0.692Fixes a bug in CSS
url()sanitizing (see #411)Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 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.