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
- Apostrophe has default XSS via `xmp` raw-text passthrough in `sanitize-html` - CVE-2026-44990
- Sanitize-html Vulnerable To REDoS Attacks - CVE-2022-25887
- sanitize-html Information Exposure vulnerability - CVE-2024-21501
- Deep Merge is Vulnerable to Prototype Pollution Through Lack of Sanitization - CVE-2026-6594
You might also like:
- Tags:
- npm
- sanitize-html
Anything's wrong? Let us know Last updated on September 12, 2025


