Skip to content
OpenAdvisories
Medium · 5.3 CVE-2025-29771 EUVD-2025-7889GHSA-vhv4-fh94-jm5x

HtmlSanitizer vulnerable to XSS when used with contentEditable

Published Mar 14, 2025 · Updated Mar 18, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
jitbit HtmlSanitizer < 2.0.3 —

Affected packages

EcosystemPackageAffectedFixedRecord
npm @jitbit/htmlsanitizer < 2.0.3 2.0.3 GHSA-vhv4-fh94-jm5x

References