Skip to content

[deps]: Update HtmlSanitizer to 9.0.892 [SECURITY]#839

Merged
jrmccannon merged 1 commit intomainfrom
renovate/nuget-htmlsanitizer-vulnerability
Feb 3, 2026
Merged

[deps]: Update HtmlSanitizer to 9.0.892 [SECURITY]#839
jrmccannon merged 1 commit intomainfrom
renovate/nuget-htmlsanitizer-vulnerability

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Feb 3, 2026

This PR contains the following updates:

Package Change Age Confidence
HtmlSanitizer 9.0.8869.0.892 age confidence

GitHub Vulnerability Alerts

GHSA-j92c-7v7g-gj3f

Impact

If the template tag is allowed, its contents are not sanitized. The template tag is a special tag that does not usually render its contents, unless the shadowrootmode attribute is set to open or closed.

The lack of sanitization of the template tag brings up two bypasses:

  1. it is still possible to forcibly render the contents of a <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.
  2. If in addition to the template tag, the shadowrootmode attribute is allowed through sanitizer.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 template tag is disallowed by default.

Patches

The problem has been patched in versions 9.0.892 and 9.1.893-beta.

Workarounds

Disallow the template tag. 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.892

Sanitize contents of template tag

v9.0.889: 9.0.889

Update NuGet packages


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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from a team as a code owner February 3, 2026 19:32
@renovate renovate bot added the security label Feb 3, 2026
@renovate renovate bot requested a review from a team February 3, 2026 19:32
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 36.80%. Comparing base (6424fd4) to head (ac749eb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #839   +/-   ##
=======================================
  Coverage   36.80%   36.80%           
=======================================
  Files         586      586           
  Lines       31474    31474           
  Branches      903      903           
=======================================
  Hits        11585    11585           
  Misses      19742    19742           
  Partials      147      147           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@jrmccannon jrmccannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran locally and seemed to be fine. Unsure why the automated migrations are failing. That will have to be looked into.

@jrmccannon jrmccannon merged commit 6c96638 into main Feb 3, 2026
12 of 16 checks passed
@jrmccannon jrmccannon deleted the renovate/nuget-htmlsanitizer-vulnerability branch February 3, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant