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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| mganss | HtmlSanitizer | < 9.2.1039, 10.0.0-beta – < 10.0.1037-beta | 9.2.1039 |
References
- Patch Commit 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
- HtmlSanitizer v9.2.1039 Release Notes release-notes
- HtmlSanitizer v10.0.1037-beta Release Notes release-notes
- https://github.com/mganss/HtmlSanitizer product
- VulnCheck Advisory: HtmlSanitizer before 9.2.1039 XSS via SanitizeDom Body and HTML Attributes third-party-advisory