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

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). 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
    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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.