Categories
CVE-2026-107380 medium CVSS 5.4

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

  1. Attacker defines a DTD entity whose name collides with an HTML5 Named Character Reference:

    <!ENTITY Tab "#">
    

    In XML, &Tab; expands to the literal string "#" (from the DTD definition).
    In HTML5, &Tab; is a Named Character Reference that resolves to U+0009 (TAB character).

  2. The SVG uses this entity in an href:

    
    
  3. During sanitization (XML context): &Tab; → "#" → the sanitizer sees href="#javascript:alert(document.domain)" → starts with # → isHrefSafeValue() returns TRUE → passes through.

  4. Sanitizer output: saveXML() outputs the entity reference &Tab; (not the expanded value), and strips the DOCTYPE declaration.

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

❓ What is the problem

Cross-site scripting (XSS) (CWE-79) exists in enshrined/svg-sanitize. Attackers reach the vulnerable code path via XSS_CONFIRMED_POC.html.

📍 Affected scope

Check the vendor advisory for the affected versions of enshrined/svg-sanitize. Attack surface: XSS_CONFIRMED_POC.html / document.cookie.

🔥 Severity

Severity: Medium (CVSS 5.4/10). Risk of unauthorized operations or information disclosure.

🔧 How to fix

Update to 1.0.0.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

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

  1. 1
    Identify exposure identify
    grep -r 'enshrined/svg-sanitize' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で enshrined/svg-sanitize を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade enshrined/svg-sanitize to 1.0.0

    ステージング環境で 1.0.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

composer enshrined/svg-sanitize
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.0"}]}]
Packagist enshrined/svg-sanitize
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.0"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details