# CVE-2019-25225: sanitize-html XSS vulnerability in custom transformTags

Source: https://junglewise.ai/threats/cve-2019-25225-sanitize-html-xss-vulnerability-in-custom-transformtags  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-09-08. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2019-25225 · Severity: low · CVSS 3.1 · Published 2025-09-08

sanitize-html is a JavaScript library used to clean and validate HTML content, commonly employed by web applications to prevent malicious code injection. The library fails to properly sanitize HTML attributes when using custom tag transformation options, allowing an attacker to inject malicious JavaScript that executes in a victim's browser when they visit a compromised page.

Technologies: [sanitize-html (npm)](https://junglewise.ai/threats/technologies/sanitize-html). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2019-25225 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2019-25225 being exploited in the wild.

**How severe is CVE-2019-25225?** Low severity, with a CVSS score of 3.1, published 8 September 2025.

**Which products and versions are affected?** sanitize-html (npm) SEMVER:introduced=0,fixed=2.0.0-beta.

**Is there a fix for CVE-2019-25225?** Yes. sanitize-html (npm): upgrade to 2.0.0-beta or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2019-25225 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2019-25225?** Check whether you run sanitize-html (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- sanitize-html (npm): upgrade to 2.0.0-beta or later

  ```sh
  npm install sanitize-html@2.0.0-beta
  ```


## Technical details

sanitize-html prior to version 2.0.0-beta is vulnerable to Stored or Reflected Cross-Site Scripting (XSS) due to incomplete attribute sanitization in the transformTags feature. The opentag function in index.js does not apply sanitization filters to attribute values when custom tag transformations are enabled, which are intended to convert attribute values into text. An attacker can supply malicious JavaScript code in HTML attributes that passes through the unsanitized code path, resulting in arbitrary JavaScript execution. The vulnerability requires the application to use custom transformTags and place user input into HTML attributes. A fix is available in version 2.0.0-beta and later.

## Affected products

- ApostropheCMS sanitize-html prior to 2.0.0-beta

## Identifiers

- CVE-2019-25225
- GHSA-qhxp-v273-g94h

## Timeline

- 2025-09-08: disclosed: Advisory published
- 2025-09-12: advisory: GitHub advisory database reviewed

## References

- [https://github.com/apostrophecms/sanitize-html/issues/293](https://github.com/apostrophecms/sanitize-html/issues/293)

## Related threats

- [sanitize-html incomplete : meta refresh URL scheme bypass](https://junglewise.ai/threats/cve-2026-113661-apostrophecms-incomplete-meta-http-equiv-refresh-content-still)
- [ApostropheCMS sanitize-html: SMIL animation namespace-prefix bypass allows javascript: URI injection (XSS)](https://junglewise.ai/threats/cve-2026-113657-apostrophecms-is-an-open-source-node-js-content-management)
- [sanitize-html noscript XSS bypass](https://junglewise.ai/threats/cve-2026-113654-apostrophecms-is-an-open-source-node-js-content-management)
- [sanitize-html unbounded recursion denial of service](https://junglewise.ai/threats/cve-2026-113650-apostrophecms-is-an-open-source-node-js-content-management)
- [sanitize-html stored XSS via SVG SMIL URI-list scheme bypass](https://junglewise.ai/threats/cve-2026-84371-sanitize-html-stored-xss-via-svg-smil-uri-list-scheme-bypass)
