# CVE-2026-84371: sanitize-html stored XSS via SVG SMIL URI-list scheme bypass

Source: https://junglewise.ai/threats/cve-2026-84371-sanitize-html-stored-xss-via-svg-smil-uri-list-scheme-bypass  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-01. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-84371 · Severity: medium · CVSS 5.4 · Published 2026-09-01

sanitize-html is a widely-used Node.js library that filters HTML to prevent injection attacks. When applications allow SVG animations, this library fails to recognize that the `values` attribute in SMIL animation elements can contain a semicolon-separated list of URLs. An attacker can bypass the configured scheme policy by prefixing a malicious JavaScript URL with a safe fragment (e.g., `#safe;javascript:...`), allowing stored XSS when a victim interacts with the animated link. This affects applications that accept user-provided SVG content and rely on sanitize-html's filtering.

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

## Quick answers

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

**How severe is CVE-2026-84371?** Medium severity, with a CVSS score of 5.4, published 1 September 2026.

**Which products and versions are affected?** sanitize-html (npm) >=1.9.0, <=2.17.6, SEMVER:introduced=1.9.0,fixed=2.17.7.

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

**How is CVE-2026-84371 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-84371?** 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.17.7 or later

  ```sh
  npm install sanitize-html@2.17.7
  ```


## Technical details

This is a stored cross-site scripting (XSS) vulnerability (CWE-79) in the sanitize-html library's SVG sanitization logic. The root cause is in `index.js:371-383`, where the library validates URL attributes as flat strings without recognizing SMIL URI-list semantics. When an SVG `animate` element has `attributeName="href"` (or `xlink:href`), the sibling `values` attribute is interpreted by browsers as a semicolon-separated list of URLs per SMIL specification. The vulnerability allows an attacker to inject a payload like `values="#safe;javascript:alert('XSS')"` that bypasses the scheme check: the leading `#safe` fragment passes validation, but the complete list including `javascript:` is retained in the sanitized output. When a victim clicks the animated link, the browser executes the JavaScript in the application's origin. Exploitation requires that the application configures sanitize-html to allow SVG and `animate` tags, and applies a scheme policy to `values` (which should block `javascript:`). A patch was released in version 2.17.7; affected versions are 1.9.0 through 2.17.6.

## Affected products

- npm sanitize-html >=1.9.0, <=2.17.6

## Identifiers

- CVE-2026-84371
- GHSA-g8qq-57p8-ggw5

## Timeline

- 2026-09-01: disclosed: GHSA-g8qq-57p8-ggw5 and CVE-2026-84371 published
- 2026-09-01: patched: Patched in sanitize-html 2.17.7

## References

- [https://api.github.com/users/koyokr](https://api.github.com/users/koyokr)
- [https://github.com/koyokr](https://github.com/koyokr)
- [https://api.github.com/users/koyokr/gists%7B/gist_id%7D](https://api.github.com/users/koyokr/gists%7B/gist_id%7D)
- [https://api.github.com/users/koyokr/repos](https://api.github.com/users/koyokr/repos)
- [https://avatars.githubusercontent.com/u/20319256?v=4](https://avatars.githubusercontent.com/u/20319256?v=4)
- [https://api.github.com/users/koyokr/events%7B/privacy%7D](https://api.github.com/users/koyokr/events%7B/privacy%7D)

## 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 XSS bypass via textarea solidus close tag](https://junglewise.ai/threats/cve-2026-63670-sanitize-html-xss-bypass-via-textarea-solidus-close-tag)
