CVE-2019-25225 sanitize-html is vulnerable to XSS through incomprehensive sanitization

Medium 6.1 Published Updated

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.

PackageAffectedFixed in
sanitize-html npmAll versions2.0.0-beta
sanitize-html npmAll versions2.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.

Sources

Also known as CLSA-2026-1775003160, GHSA-qhxp-v273-g94h, ROOT-APP-NPM-CVE-2019-25225, UBUNTU-CVE-2019-25225.

Is CVE-2019-25225 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free