MediumGHSA-qhxp-v273-g94hCVE-2019-25225

sanitize-html is vulnerable to XSS through incomprehensive sanitization

Published 8 Sept 2025 · Updated 12 Sept 2025

Affected package

Affected
<2.0.0-beta
Fixed in
2.0.0-beta
Update to the fixed version for your release line, for example:npm install sanitize-html@2.0.0-beta

Details

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.

Is GHSA-qhxp-v273-g94h in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected sanitize-html, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.