GitHub Advisoryadvisory · npm

GHSA-qhxp-v273-g94h sanitize-html is vulnerable to XSS through incomprehensive sanitization

MEDIUM Published 2025-09-08 Modified 2025-09-12 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