Cross-Site Scripting (XSS) in enshrined/svg-sanitize (CVE-2026-107380)
Summary
Cross-site scripting in enshrined/svg-sanitize (CVE-2026-107380). Risk of unauthorized operations or information disclosure. Exploitable via XSS_CONFIRMED_POC.html. Mitigation: upgrade to 1.0.0 or later.
Original description
The description as published by the source.
Summary
A crafted SVG bypasses enshrined/svg-sanitize's href validation and delivers a javascript: URL through the sanitizer unchanged. The bypass exploits a semantic mismatch between XML entity resolution (used during sanitization) and HTML5 Named Character Reference resolution (used by the browser when the SVG is rendered inline).
This is a logic bug in svg-sanitize. It does NOT depend on any PHP ext/dom bug — it works on any PHP version.
Affected installations:
- enshrined/svg-sanitize: 45.2M Packagist downloads, 1.3M/month, 90+ dependents
- WordPress Safe SVG plugin: 1M+ active installs (inline SVG rendering via themes)
- TYPO3, Drupal and 90+ other Packagist dependents
Vulnerability Details
Mechanism
-
Attacker defines a DTD entity whose name collides with an HTML5 Named Character Reference:
<!ENTITY Tab "#">In XML,
	expands to the literal string"#"(from the DTD definition).
In HTML5,	is a Named Character Reference that resolves to U+0009 (TAB character). -
The SVG uses this entity in an href:
-
During sanitization (XML context):
	→"#"→ the sanitizer seeshref="#javascript:alert(document.domain)"→ starts with#→isHrefSafeValue()returns TRUE → passes through. -
Sanitizer output:
saveXML()outputs the entity reference	(not the expanded value), and strips the DOCTYPE declaration. -
In the browser (HTML5 context):…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-107380 has been found in enshrined/svg-sanitize.
Attackers can target a specific entry point like XSS_CONFIRMED_POC.html over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 5.4/10.
What to do: upgrade enshrined/svg-sanitize to 1.0.0 or later.
If unsure, ask your IT team or search "enshrined/svg-sanitize CVE-2026-107380" on the vendor's site.
CVE-2026-107380 (enshrined/svg-sanitize) — CWE-79 / CVSS v3 5.4
Attack vector: remote (network-reachable)
Attack surface: XSS_CONFIRMED_POC.html / document.cookie
Patched: 1.0.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Cross-site scripting (XSS) (CWE-79) exists in enshrined/svg-sanitize. Attackers reach the vulnerable code path via XSS_CONFIRMED_POC.html.
Check the vendor advisory for the affected versions of enshrined/svg-sanitize. Attack surface: XSS_CONFIRMED_POC.html / document.cookie.
Severity: Medium (CVSS 5.4/10). Risk of unauthorized operations or information disclosure.
Update to 1.0.0.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'enshrined/svg-sanitize' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'enshrined/svg-sanitize' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
enshrined/svg-sanitizeを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade enshrined/svg-sanitize to 1.0.0ステージング環境で 1.0.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com