CVE-2026-25543: mganss HtmlSanitizer · Improper Encoding or Escaping of Output
Affects mganss HtmlSanitizerSource CVE Database V5
Not known to be exploited · CVSS 6.3 Medium : upgrade to 9.1.893-beta or 9.0.892 when convenient.
Data as of 26 Oct 2026, 09:16 UTC
- EPSS
- 0.2% chance of exploitation in 30 days – higher than 20% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 9.1.893-beta, 9.0.892
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 4 Feb 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade HtmlSanitizer to 9.1.893-beta or 9.0.892; htmlsanitizer to 9.0.892.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| mganssHtmlSanitizer | Affected
| Fixed in
|
NuGethtmlsanitizerpkg:nuget/htmlsanitizerOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
1. Upgrade all instances of mganss HtmlSanitizer to version 9.0.892 or later (including 9.1.893-beta) to apply the official patch addressing this vulnerability. 2. Audit existing codebases to identify usage of the <template> tag within sanitized HTML and assess whether it is necessary to allow this tag. 3. If the <template> tag is required, implement additional custom sanitization or validation to ensure its contents do not contain executable scripts or malicious payloads. 4. Employ Content Security Policy (CSP) headers to restrict script execution and reduce the impact of potential XSS attacks. 5. Conduct thorough security testing, including static analysis and dynamic scanning, focusing on HTML sanitization and injection points. 6. Educate developers on secure handling of HTML content and the risks associated with improper sanitization of special tags like <template>. 7.
Description
CVE-2026-25543 is a medium severity vulnerability in the mganss HtmlSanitizer . NET library, affecting versions prior to 9.0.892 and 9.1.893-beta. The flaw arises from improper encoding or escaping of output (CWE-116) when the HTML template tag is allowed, as its contents are not sanitized unless the shadowrootmode attribute is set. This can lead to cross-site scripting (XSS) attacks if malicious content is injected within template tags. The vulnerability does not require authentication or user interaction and can be exploited remotely over the network. Although no known exploits are currently reported in the wild, the issue has been patched in the specified versions.
References
- github.com/mganss/HtmlSanitizer/security/advisories/GHSA-j92c-7v7g-gj3f (opens in a new tab)
- github.com/mganss/HtmlSanitizer/commit/0ac53dca30ddad963f2b243669a5066933d82b81 (opens in a new tab)
- nuget.org/packages/HtmlSanitizer/9.0.892 (opens in a new tab)
- nuget.org/packages/HtmlSanitizer/9.1.893-beta (opens in a new tab)