What’s Vulnerable › Vulnerabilities
CVE-2026-116538: HtmlSanitizer before 9.2.1039 XSS via SanitizeDom Body and HTML Attributes
- Severity: medium (CVSS 4.7 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.3% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2026-10-26 · updated 2026-10-31
- Weakness: CWE-79
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.
Affected products
- mganss HtmlSanitizer: before 9.2.1039; from 10.0.0-beta before 10.0.1037-beta — fixed in 9.2.1039, 10.0.1037-beta
How to fix
Upgrade to a fixed version: mganss HtmlSanitizer 9.2.1039, 10.0.1037-beta. Check the vendor advisory for mitigations.
References
- https://github.com/mganss/HtmlSanitizer
- https://github.com/mganss/HtmlSanitizer/blob/v9.2.995/src/HtmlSanitizer/HtmlSanitizer.cs#L456-L465
- https://github.com/mganss/HtmlSanitizer/blob/v9.2.995/src/HtmlSanitizer/HtmlSanitizer.cs#L555-L583
- https://github.com/mganss/HtmlSanitizer/commit/96afbc818e64de7571ea17954a05d523e819c56f
- https://github.com/mganss/HtmlSanitizer/commit/ab626e7a4f2893f7e9ec0a72779ae19c5ec439a7
- https://github.com/mganss/HtmlSanitizer/releases/tag/v10.0.1037-beta
- https://github.com/mganss/HtmlSanitizer/releases/tag/v9.2.1039
- https://joshua.hu/htmlsanitizer-sanitizedom-body-html-attribute-bypass
- https://www.vulncheck.com/advisories/htmlsanitizer-before-9.2.1039-xss-via-sanitizedom-body-and-html-attributes
Get alerted when CVE-2026-116538 or the next vulnerability affects your stack