Vulnerability · Published Mar 14, 2025 · Assigned by GitHub_M
CVE-2025-29771HtmlSanitizer vulnerable to XSS when used with contentEditable
Medium 5.3
In plain English
A medium-severity cross-site scripting in HtmlSanitizer from jitbit. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 35% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
HtmlSanitizer is a client-side HTML Sanitizer. Versions prior to 2.0.3 have a cross-site scripting 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. The issue is patched in version 2.0.3.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | @jitbit/htmlsanitizer | 2.0.3 | GHSA-vhv4-fh94-jm5x |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| jitbit | HtmlSanitizer | < 2.0.3 |
Weakness: CWE-79 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N