Średnia

HtmlSanitizer has a bypass via template tag

  • Ujawniono: 03.02.2026
  • Aktualizacja: 11.10.2026 11:23

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

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
.NET (NuGet) HtmlSanitizer < 9.0.892, >= 9.1.878-beta, < 9.1.893-beta 9.0.892, 9.1.893-beta

Odnośniki

Ocena CVSS -
Wektor CVSS
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Słabość (CWE)
CWE-116, CWE-79
Platforma
.NET (NuGet)
Paczka
HtmlSanitizer
Ujawniono
03.02.2026
Aktualizacja
11.10.2026 11:23

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-j92c-7v7g-gj3f - CC BY 4.0

Historia podatności: HtmlSanitizer

Wszystkie opisane podatności tej paczki (.NET (NuGet)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkich wpisów
3
Pierwsza → ostatnia
01.2021 02.2026
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Średnia 2
  • Niska 1

Ujawnienia w latach

  1. 2021: 1
  2. 2022: 0
  3. 2023: 1
  4. 2024: 0
  5. 2025: 0
  6. 2026: 1
  1. HtmlSanitizer has a bypass via template tag ten wpis
    Średnia CVE-2026-25543 < 9.0.892, >= 9.1.878-beta, < 9.1.893-beta 9.0.892, 9.1.893-beta
  2. Średnia · 6.1 CVE-2023-44390 < 8.0.723, >= 8.1.0-beta, < 8.1.722-beta 8.0.723, 8.1.722-beta
  3. Niska · 6.1 CVE-2020-26293 < 5.0.372 5.0.372

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.