Loading advisory.
Loading advisory.
HtmlSanitizer has a bypass via template tag
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.
Published 2026-02-03 19:22 UTC · Modified 2026-02-28 06:26 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| HtmlSanitizer | NuGet | < 9.0.892 >= 9.1.878-beta, < 9.1.893-beta versions 1.0.4925.29815, 1.0.4927.30873, 1.1.5243.28448, 1.1.5297.28403, 1.1.5338.17998, 2.0.5449.20550, 2.0.5548.24932, 2.0.5595.22183, 2.0.5595.30325, 2.0.5623.30465, 2.0.5735.24296, 3.0.5781.31354-beta, 3.0.66-beta, 3.1.67-beta, 3.1.75-beta, 3.1.76, 3.1.79, 3.1.91, 3.1.93, 3.1.98 and 100 more | 9.0.892, 9.1.893-beta | dotnet add package HtmlSanitizer --version 9.0.892dotnet add package HtmlSanitizer --version 9.1.893-beta |
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:
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.
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.
The problem has been patched in versions 9.0.892 and 9.1.893-beta.
Disallow the template tag. It is disallowed by default.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.003 on 2026-11-24 to 0.004 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.003 | first score | v2026.06.15 |
| 2026-11-26 | 0.004 | 0.003 | v2026.06.15 |