CVE-2019-25225 sanitize-html is vulnerable to XSS through incomprehensive sanitization
Attackers can execute arbitrary scripts via malicious input when using the custom transformTags option in the sanitize-html library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2019-25225?
CVE-2019-25225 is a medium-severity cross-site scripting vulnerability in apostrophecms:sanitize-html, published on 8 Sep 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official 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.
Weakness: CWE-79
Which versions are affected by CVE-2019-25225?
2 open source packages ship an affected version, including sanitize-html. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
sanitize-html npm | All versions | 2.0.0-beta |
sanitize-html npm | All versions | 2.0.0-beta |
Products include Apostrophecms Sanitize-Html.
How do I fix CVE-2019-25225?
Upgrade sanitize-html to 2.0.0-beta or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2019-25225 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2019-25225 exists.
Other vulnerabilities in apostrophecms:sanitize-html
- CVE-2014-125128 Cross-site scripting in apostrophecms:sanitize-html
- CVE-2016-1000237 Cross-Site Scripting in sanitize-html
- CVE-2024-21501 sanitize-html Information Exposure vulnerability
- CVE-2022-25887 Regular Expression Denial of Service (ReDoS)
- CVE-2021-26539 Improper Input Validation in sanitize-html
Sources
Also known as CLSA-2026-1775003160, GHSA-qhxp-v273-g94h, ROOT-APP-NPM-CVE-2019-25225, UBUNTU-CVE-2019-25225.