Improper Encoding or Escaping of Output Affecting htmlsanitizer package, versions [,9.0.892)[9.1.878-beta,9.1.893-beta)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.04% (13th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Encoding or Escaping of Output vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-DOTNET-HTMLSANITIZER-15191461
  • published4 Feb 2026
  • disclosed3 Feb 2026
  • creditnsysean

Introduced: 3 Feb 2026

NewCVE-2026-25543  (opens in a new tab)
CWE-116  (opens in a new tab)

How to fix?

Upgrade HtmlSanitizer to version 9.0.892, 9.1.893-beta or higher.

Overview

HtmlSanitizer is a Cleans HTML from constructs that can be used for cross site scripting (XSS).

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output in the template tag handling. An attacker can inject and execute arbitrary scripts by crafting HTML content that leverages unsanitized template tags, potentially using deep DOM nesting or the shadowrootmode attribute to bypass sanitization.

Note: This is only exploitable if the template tag is explicitly allowed in the sanitizer configuration or if the shadowrootmode attribute is permitted.

Workaround

This vulnerability can be mitigated by disallowing the template tag, which is the default configuration.

CVSS Base Scores

version 4.0
version 3.1