Skip to main content

svg-sanitizer EUVDEUVD-2026-95137

| CVE-2026-107380 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-10-08 security-advisories@github.com GHSA-9rjx-3jch-6vjf
5.4
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted SVG with DTD entity in href
  2. Delivery
    svg-sanitizer validates href post-expansion, re-serializes entity
  3. Exploit
    App embeds sanitized SVG inline as HTML
  4. Execution
    Victim activates link, HTML5 reference resolves to javascript:
  5. Impact
    Script executes in embedding page origin

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that: (1) the target application uses svg-sanitizer prior to 1.0.0 and embeds its output INLINE as HTML (not as a referenced <img>/external resource, where HTML5 named-character-reference resolution would not apply to the href); (2) the attacker can supply SVG input to the sanitizer (typically an authenticated content-submission path, consistent with PR:L); and (3) a victim actively activates the resulting link (UI:R). The attacker must craft an SVG using a DTD-defined entity (e.g. a Tab-style named reference) inside an href so that it passes isHrefSafeValue() after entity expansion yet survives serialization as the original entity reference. Limiting factors: no remote-unauthenticated path, mandatory victim interaction, and dependence on the embedding application rendering the SVG inline - applications that render SVG in isolated contexts or sanitize downstream are not exposed.

Impact

This is a moderate-severity stored/DOM XSS sanitizer-bypass (CWE-79) with a provided CVSS 3.1 vector of AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N scoring 5.4 (Medium). The network attack vector and low complexity are real, but two factors materially constrain real-world risk: PR:L means the attacker must already be able to submit SVG content to the target application (an authenticated contributor/uploader in most deployments), and UI:R means a victim must actively click/activate the crafted link before script executes. The scope change (S:C) correctly reflects that execution lands in the embedding page's origin rather than the sanitizer itself. No EPSS score, KEV listing, or SSVC decision data was provided, and no public exploit was referenced - so there is no public exploit identified at time of analysis. The signals are internally consistent (no CVSS-versus-description conflict): the description's 'a user who activates the link' matches UI:R, and 'application embeds the sanitized SVG inline' matches the stored/second-order nature. Bottom line: a credible defense-in-depth bug worth patching promptly in affected deployments, but not an emergency - it depends on attacker content-submission ability, victim interaction, and the embedding application rendering the SVG inline as HTML.

Exploit ScenarioDerived

An attacker with the ability to upload or submit SVG content (e.g. an authenticated user of a CMS, forum, or avatar/upload feature) crafts an SVG whose href uses a DTD-defined entity such as a tab reference that svg-sanitizer validates as safe before entity expansion, while saveXML() re-serializes the original entity reference. When the host application embeds the sanitized SVG inline, HTML5 named-character-reference resolution converts the surviving reference to whitespace and unmasks a javascript: URL. A victim who then clicks the link executes attacker-controlled script in the embedding page's origin. No public exploit code was referenced in the provided data.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 08, 2026

Sanitizer bypass in svg-sanitizer (darylldoyle/svg-sanitizer) before 1.0.0 allows a crafted SVG href built from a DTD-defined XML entity to pass isHrefSafeValue() after entity expansion yet survive serialization as the original entity reference, which HTML5 named-character-reference resolution then converts to whitespace inside a javascript: URL. When an application embeds the sanitized SVG inline as HTML, an authenticated content submitter (CVSS 3.1 vector indicates PR:L) can therefore obtain script execution in the embedding page's origin, but only if a victim activates the link (UI:R); severity is moderate (CVSS 3.1 base 5.4, Medium) and no public exploit code or confirmed active exploitation was identified at time of analysis. Applications that render sanitized SVG only as a referenced <img>/external resource or inside an isolated context are not exposed.

RemediationAI

Vendor-released patch: 1.0.0 - upgrade svg-sanitizer to 1.0.0 or later, which strips DOCTYPE/DTD (including the internal subset) before parsing and collapses the entity-expansion/serialization mismatch; the fix is the commit https://github.com/darylldoyle/svg-sanitizer/commit/23877db7e76f1e1df5c3e65ab30239219c3d2867 and the release is https://github.com/darylldoyle/svg-sanitizer/releases/tag/1.0.0, with details in https://github.com/darylldoyle/svg-sanitizer/security/advisories/GHSA-9rjx-3jch-6vjf. Because 1.0.0 fails closed, applications that previously submitted SVGs containing custom entity definitions must be updated to handle a boolean false return (treat it as a rejection, not as clean output). If upgrading is not immediately possible, the most direct compensating control is to strip or reject any '<!DOCTYPE' declaration (and its internal subset) from input before it reaches the sanitizer, mirroring the upstream fix - the trade-off is that this can break otherwise valid Illustrator/Inkscape exports, although PUBLIC DOCTYPEs without entity definitions can be allowed through after removal. A second control is to stop embedding sanitized SVG inline in the host page: render it as an external image or isolate it in an iframe on a separate origin so HTML5 named-character-reference resolution never applies to the resulting href - the trade-off is loss of inline styling/scripting integration and changes to layout. Finally, enforce a Content-Security-Policy that blocks inline and javascript: script execution in the embedding origin, and apply output-side URL scheme validation (allowing only http/https/relative) after sanitization; both reduce impact but can break legitimate inline scripts and links, and neither fixes the underlying sanitizer bypass for other payload shapes.

Affected VersionsENISA

svg-sanitizer < 1.0.0

Affected Packages

composer enshrined/svg-sanitize fix: 1.0.0
euvd svg_sanitizer fix: 1.0.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

svg-sanitizer is a PHP library that parses untrusted SVG/XML with libxml/DOMDocument, strips dangerous elements and attributes, and re-serializes the tree. In versions before 1.0.0 the parser still processed internal DTD subsets, so a custom entity declaration (e.g. a Tab-style named reference) was expanded during parsing and isHrefSafeValue() inspected the expanded, apparently harmless value. However, saveXML() writes back the original entity reference after the DTD declaration has been removed by the sanitizer, so the sanitized output contains an unresolved, attacker-controlled entity token. If that output is embedded inline in an HTML document, the browser's HTML5 named character reference resolution converts the surviving reference into whitespace, and a URL such as 'java\tscript:' is normalized to the javascript: scheme - the classic CWE-79 sanitizer-bypass pattern (improper neutralization of input during web page generation, with a decode/serialization mismatch as the root cause). The 1.0.0 fix (commit 23877db7e76f1e1df5c3e65ab30239219c3d2867) removes any DOCTYPE/DTD, including its internal subset, using a balanced-bracket scanner before the input reaches libxml, so custom entity definitions and DTD-defaulted attributes can no longer be introduced; the same commit also hardens detection of remote url()/@import and bare remote href/src values and prevents attributes from being stripped twice in one loop, and, as a fail-safe, documents that reference now-undefined custom entities cause sanitize() to return false instead of a cleaned string.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 5.4 MEDIUM

Attacker must supply content (PR:L) and a victim must activate the link (UI:R); successful injection runs script in the embedding origin (S:C) with limited C/I impact and no availability effect.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

1
Patch available
Oct 08, 2026 - 19:18 EUVD

DescriptionCVE.org

savg-sanitizer is a PHP SVG/XML sanitizer. Prior to 1.0.0, svg-sanitizer's isHrefSafeValue() validates an SVG href after XML DTD entity expansion, but saveXML() serializes the original entity reference after removing the DTD declaration. A crafted entity such as Tab can appear to the sanitizer as a safe fragment prefix while HTML5 Named Character Reference resolution during inline HTML rendering later converts the surviving reference to whitespace, exposing a javascript: URL. When an application embeds the sanitized SVG inline, a user who activates the link can cause script to execute in the embedding page's origin. This issue is fixed in version 1.0.0.

Threat Intelligence Overview

EPSS Score
0.2%
Top 90% exploitable
Prevalence
Medium
widely-used PHP SVG sanitization library, but language- and feature-specific footprint
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy