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.

Severity (CVSS 4.0)5.3Medium
Exploit odds (30 days)0.4%top 65.2% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
npm@jitbit/htmlsanitizer2.0.3GHSA-vhv4-fh94-jm5x

Affected products (as reported)

VendorProductVersions
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

References