GitHub Advisoryadvisory · npm
GHSA-qhxp-v273-g94h sanitize-html is vulnerable to XSS through incomprehensive sanitization
MEDIUM
Official page ↗
- Aliases
- CVE-2019-25225
- Ecosystem
- npm
- Packages
- sanitize-html
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2025-09-12
Affected packages
• npm sanitize-html: < 2.0.0-beta → fixed in 2.0.0-beta
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.
Related
Alias · CVE (1)
- CVE-2019-25225 `sanitize-html` prior to version 2.0.0-beta is vulnerable to Cross-site Scripting (XSS). vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2019-25225 advisory
- https://github.com/apostrophecms/sanitize-html/issues/293 web
- https://github.com/apostrophecms/sanitize-html/pull/156 web
- https://github.com/apostrophecms/sanitize-html/commit/712cb6895825c8bb6ede71a16b42bade42abcaf3 web
- https://github.com/Checkmarx/Vulnerabilities-Proofs-of-Concept/tree/main/2019/CVE-2019-25225 web
- https://github.com/apostrophecms/sanitize-html package