HtmlSanitizer vulnerabilities

Cleans HTML from constructs that can be used for cross-site scripting (XSS)

Registry
NuGet
Latest
11.0.26
License
MIT

3 known advisories

The latest version, 11.0.26, is not affected by any of them. Projects on older versions may be.

Update to the latest version:dotnet add package HtmlSanitizer --version 11.0.26

Is your project on an affected HtmlSanitizer?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several .NET apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Security advisories for HtmlSanitizer

  • MediumCVE-2026-25543GHSA-j92c-7v7g-gj3f3 Feb 2026

    HtmlSanitizer has a bypass via template tag

    Affected
    <9.0.892 · >=9.1.878-beta <9.1.893-beta
    Fixed in
    9.0.892, 9.1.893-beta
  • MediumCVE-2023-44390GHSA-43cp-6p3q-2pc44 Oct 2023

    HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content

    Affected
    <8.0.723 · >=8.1.0-beta <8.1.722-beta
    Fixed in
    8.0.723, 8.1.722-beta
  • LowCVE-2020-26293GHSA-8j9v-h2vp-2hhv4 Jan 2021

    XSS in HtmlSanitizer

    Affected
    <5.0.372
    Fixed in
    5.0.372

Is your HtmlSanitizer version vulnerable?

Which of your client projects still run an old HtmlSanitizer?

NPMscan reads the packages.lock.json and .csproj files in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other NuGet packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the NuGet registry.