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

Source: https://junglewise.ai/threats/cve-2026-107380-enshrined-svg-sanitize-stored-xss-via-dtd-entity-html5-named  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-08. Updated: 2026-10-08  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/enshrined-svg-sanitize). Vendors: [Enshrined](https://junglewise.ai/threats/vendors/enshrined), [Packagist](https://junglewise.ai/threats/vendors/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

  ```sh
  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

## Related threats

- [svg-sanitizer case-insensitive xlink:href DoS bypass](https://junglewise.ai/threats/cve-2026-107381-svg-sanitizer-mixed-case-xlink-href-skips-the-use-nesting-dos)
- [enshrined svg-sanitize denial of service via DTD attribute declaration](https://junglewise.ai/threats/cve-2026-107379-enshrined-svg-sanitize-denial-of-service-via-dtd-attribute)
- [svg-sanitizer Bypasses Attribute Sanitization](https://junglewise.ai/threats/cve-2025-55166-svg-sanitizer-bypasses-attribute-sanitization)
- [svg-sanitizer has Cross-site Scripting Bypass](https://junglewise.ai/threats/cve-2023-28426-svg-sanitizer-has-cross-site-scripting-bypass)
- [Cross-site Scripting in enshrined/svg-sanitize](https://junglewise.ai/threats/cve-2022-23638-cross-site-scripting-in-enshrined-svg-sanitize)
