HtmlSanitizer before 9.2.1039 and 10.0 prereleases before 10.0.1037-beta contains a cross-site scripting vulnerability because SanitizeDom(string) never sanitizes attributes on the html and body wrapper elements
Source GCVE Database
Not known to be exploited · CVSS 2.3 Low : upgrade to 10.0.1037-beta or 9.2.1039 when convenient.
Data as of 26 Oct 2026, 19:44 UTC
- Patch
- Available – fixed in 10.0.1037-beta, 9.2.1039
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 26 Oct 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 10.0.1037-beta or 9.2.1039.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| mganssHtmlSanitizer | 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.
Description
HtmlSanitizer before 9.2.1039 and 10.0 prereleases before 10.0.1037-beta contains a cross-site scripting vulnerability because SanitizeDom(string) never sanitizes attributes on the html and body wrapper elements. Attackers can supply input with a second body or html tag carrying event handlers like onload, executing script when applications render serialized document or body outer HTML.
References
- nvd.nist.gov/vuln/detail/CVE-2026-116538 (opens in a new tab)
- github.com/mganss/HtmlSanitizer/commit/96afbc818e64de7571ea17954a05d523e819c56f (opens in a new tab)
- github.com/mganss/HtmlSanitizer/commit/ab626e7a4f2893f7e9ec0a72779ae19c5ec439a7 (opens in a new tab)
- github.com/mganss/HtmlSanitizer (opens in a new tab)
- github.com/mganss/HtmlSanitizer/blob/v9.2.995/src/HtmlSanitizer/HtmlSanitizer.cs (opens in a new tab)
- github.com/mganss/HtmlSanitizer/blob/v9.2.995/src/HtmlSanitizer/HtmlSanitizer.cs (opens in a new tab)
- github.com/mganss/HtmlSanitizer/releases/tag/v10.0.1037-beta (opens in a new tab)
- github.com/mganss/HtmlSanitizer/releases/tag/v9.2.1039 (opens in a new tab)
- joshua.hu/htmlsanitizer-sanitizedom-body-html-attribute-bypass (opens in a new tab)
- vulncheck.com/advisories/htmlsanitizer-before-9.2.1039-xss-via-sanitizedom-body-and-html-attributes (opens in a new tab)