# CVE-2026-25543: HtmlSanitizer has a bypass via template tag

> Attackers can bypass HTML sanitization via template tags to inject malicious scripts, leading to cross-site scripting attacks.

- **Severity:** Medium 6.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Feb 2026
- **Updated:** 5 Feb 2026
- **Also known as:** ECHO-b56b-174c-3d1b, GHSA-j92c-7v7g-gj3f

## What is CVE-2026-25543?

CVE-2026-25543 is a medium-severity cross-site scripting vulnerability in mganss HtmlSanitizer, published on 4 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

HtmlSanitizer is a .NET library for cleaning HTML fragments and documents from constructs that can lead to XSS attacks. Prior to versions 9.0.892 and 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. This issue has been patched in versions 9.0.892 and 9.1.893-beta.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation), CWE-116 (Improper Encoding or Escaping of Output)

## Which versions are affected by CVE-2026-25543?

4 open source packages ship an affected version, including HtmlSanitizer. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `HtmlSanitizer` | NuGet | All versions | 9.0.892 |
| `HtmlSanitizer` | NuGet | All versions | 9.0.892 |
| `HtmlSanitizer` | NuGet | From 9.1.878-beta | 9.1.893-beta |
| `HtmlSanitizer` | NuGet | From 9.1.878-beta | 9.1.893-beta |

Products: Htmlsanitizer Project Htmlsanitizer.

## How do I fix CVE-2026-25543?

Upgrade HtmlSanitizer to a fixed version for your release line: 9.0.892 or 9.1.893-beta.

## Is CVE-2026-25543 being exploited?

There is no known exploitation of CVE-2026-25543 in the wild and no public exploit code.

## Other vulnerabilities in mganss HtmlSanitizer

- [CVE-2023-44390](https://insights.sbomify.com/CVE-2023-44390/): HtmlSanitizer vulnerable to Cross-site Scripting in Foreign Content (medium 6.1)
- [CVE-2020-26293](https://insights.sbomify.com/CVE-2020-26293/): Possible XSS bypass if style tag is allowed (medium 6.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-25543 and fix it if it is affected.

What it is: CVE-2026-25543 is a medium-severity cross-site scripting vulnerability in mganss HtmlSanitizer, published on 4 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-25543 in the wild and no public exploit code.

Affected packages and fixed versions:
- HtmlSanitizer (NuGet): affected all versions; fixed in 9.0.892
- HtmlSanitizer (NuGet): affected all versions; fixed in 9.0.892
- HtmlSanitizer (NuGet): affected from 9.1.878-beta; fixed in 9.1.893-beta
- HtmlSanitizer (NuGet): affected from 9.1.878-beta; fixed in 9.1.893-beta

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-25543/ (Markdown: https://insights.sbomify.com/CVE-2026-25543/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-25543
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-25543
- OSV: https://osv.dev/vulnerability/CVE-2026-25543

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-25543/
Summaries are generated and may contain mistakes; the official description above is the record.
