medium6.9
CVE-2025-29771
JS Html Sanitizer allows XSS when used with contentEditable
Impact
### Impact XSS vulnerability when the sanitizer is used with a `contentEditable` element to set the elements `innerHTML` to a sanitized string produced by the package. If the code is particularly crafted to abuse the code beautifier, that runs AFTER sanitation. ### Patches Patched in version 2.0.3
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | @jitbit/htmlsanitizer | < 2.0.3 | 2.0.3 |
Affected products
| Product | Affected versions |
|---|---|
| HtmlSanitizer Is A Client-Side HTML Sanitizer. | before 2.0.3 |
Versions were read from the advisory text. No structured product data has been published for this record yet.
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/jitbit/HtmlSanitizer/commit/af6d2a78877e7277cd01c825b7fb50edb5956963
- https://github.com/jitbit/HtmlSanitizer/security/advisories/GHSA-vhv4-fh94-jm5x
- https://github.com/advisories/GHSA-vhv4-fh94-jm5x
- https://nvd.nist.gov/vuln/detail/CVE-2025-29771