CVE-2026-107380: enshrined svg-sanitize stored XSS via DTD entity collision

CVE-2026-107380 · Severity: medium · CVSS 5.4 · Published 2026-10-08

The enshrined svg-sanitize library, used by WordPress plugins and other web applications to safely process user-uploaded SVG files, fails to prevent a stored XSS attack. An attacker can upload a malicious SVG that passes sanitization checks but executes JavaScript when the SVG is embedded inline in an HTML page, potentially allowing account takeover or session theft through clicking a link.

Technologies: enshrined/svg-sanitize (Packagist). Vendors: Enshrined, Packagist.

Quick answers

Is CVE-2026-107380 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-107380 being exploited in the wild.
How severe is CVE-2026-107380?
Medium severity, with a CVSS score of 5.4, published 8 October 2026.
Which products and versions are affected?
Enshrined Svg-Sanitize 0.22.x; enshrined/svg-sanitize (Packagist) <= 0.22.0, ECOSYSTEM:introduced=0,fixed=1.0.0.
Is there a fix for CVE-2026-107380?
Yes. enshrined/svg-sanitize (Packagist): upgrade to 1.0.0 or later. Until then: Strip DOCTYPE declarations from SVG input before sanitization processing to eliminate DTD entity definitions entirely. Alternatively, implement post-serialization validation of href attributes in the sanitizer output to catch entity references that bypass XML-expanded validation checks. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-107380 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-107380?
Check whether you run Enshrined Svg-Sanitize or enshrined/svg-sanitize (Packagist) 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

  • enshrined/svg-sanitize (Packagist): upgrade to 1.0.0 or later
    composer require enshrined/svg-sanitize:^1.0.0

Strip DOCTYPE declarations from SVG input before sanitization processing to eliminate DTD entity definitions entirely. Alternatively, implement post-serialization validation of href attributes in the sanitizer output to catch entity references that bypass XML-expanded validation checks.

Technical details

The vulnerability exploits a semantic mismatch between XML entity resolution (used during sanitization) and HTML5 Named Character Reference resolution (used by browsers). An attacker crafts an SVG with a DTD entity whose name collides with an HTML5 Named Character Reference (e.g., `&Tab;` → `#` in XML, but U+0009 in HTML5). During sanitization, the entity expands to `#`, causing the href validator to incorrectly whitelist `#javascript:...` as safe. The sanitizer preserves the entity reference in output while stripping the DOCTYPE, causing the browser to resolve `&Tab;` as the HTML5 character reference, which is then stripped as whitespace by the URL parser, leaving `javascript:` as the effective scheme. This requires inline SVG rendering in HTML (not `<img src>`) and user interaction.

Affected products

  • enshrined svg-sanitize 0.22.x

Identifiers

  • CVE-2026-107380
  • GHSA-9rjx-3jch-6vjf

Timeline

  • 2026-10-08: disclosed

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