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.
Severity (CVSS)
| Base score | 2.3 |
|---|---|
| Severity | Low |
| Version | CVSS 4.0 |
| Vector | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| Provided by | CNA |
Weaknesses
- CWE-79 — Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected products
| Vendor | Product | Versions |
|---|---|---|
| mganss | HtmlSanitizer | 0 to <9.2.1039 [affected]; 10.0.0-beta to <10.0.1037-beta [affected] |
References
- https://github.com/mganss/HtmlSanitizer/commit/96afbc818e64de7571ea17954a05d523e819c56f (patch)
- https://github.com/mganss/HtmlSanitizer/commit/ab626e7a4f2893f7e9ec0a72779ae19c5ec439a7 (patch)
- https://github.com/mganss/HtmlSanitizer/blob/v9.2.995/src/HtmlSanitizer/HtmlSanitizer.cs#L456-L465 (technical-description)
- https://github.com/mganss/HtmlSanitizer/blob/v9.2.995/src/HtmlSanitizer/HtmlSanitizer.cs#L555-L583 (technical-description)
- https://joshua.hu/htmlsanitizer-sanitizedom-body-html-attribute-bypass (technical-description)
- https://github.com/mganss/HtmlSanitizer/releases/tag/v9.2.1039 (release-notes)
- https://github.com/mganss/HtmlSanitizer/releases/tag/v10.0.1037-beta (release-notes)
- https://github.com/mganss/HtmlSanitizer (product)
- https://www.vulncheck.com/advisories/htmlsanitizer-before-9.2.1039-xss-via-sanitizedom-body-and-html-attributes (third-party-advisory)
Assess this vulnerability
Compare your deployed product and version with the source record. Review vendor references for fixes and workarounds. A CVSS score describes technical severity; it does not establish that your systems are affected or that exploitation has occurred.
Browse all CVE security advisories · Symaro cybersecurity services
Generated from the official CVE List on 27 Oct 2026 07:01 UTC.