sanitize-html is vulnerable to XSS through incomprehensive sanitization
- Severity:
- Medium
Description
sanitize-html prior to version 2.0.0-beta is vulnerable to Cross-site Scripting (XSS). The sanitizeHtml() function in index.js does not sanitize content when using the custom transformTags option, which is intended to convert attribute values into text. As a result, malicious input can be transformed into executable code.
Recommendation
Update the sanitize-html package to the latest compatible version. Followings are version details:
- Affected version(s): < 2.0.0-beta
- Patched version(s): 2.0.0-beta
References
Related Issues
- Sanitize-html Vulnerable To REDoS Attacks - CVE-2022-25887
- Apostrophe has default XSS via `xmp` raw-text passthrough in `sanitize-html` - CVE-2026-44990
- auth0-lock vulnerable to XSS via unsanitized placeholder property - CVE-2019-20174
- Cross-Site Scripting in sanitize-html - sanitize-html - GHSA-3j7m-hmh3-9jmp - CVE-2016-1000237
You might also like:
- Tags:
- npm
- sanitize-html
Anything's wrong? Let us know Last updated on September 12, 2025


