Skip to content
High 8.2

Cross-Site Scripting (XSS) in svgo

CVE-2026-84370 First seen on SecPulse

Summary

Cross-site scripting in svgo (CVE-2026-84370). Confidential information can be exposed externally. Exploitable via removeScripts. Mitigation: upgrade to 4.1.0 or later.

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

A vulnerability tracked as CVE-2026-84370 has been found in svgo.
Attackers can target a specific entry point like removeScripts over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 8.2/10.
What to do: upgrade svgo to 4.1.0 or later.
If unsure, ask your IT team or search "svgo CVE-2026-84370" on the vendor's site.

CVE-2026-84370 (svgo) — CWE-79 / CVSS v3 8.2
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: removeScripts / href / removeScriptElement
Patched: 4.1.0 — apply immediately
Workaround: For hostile input, use a dedicated SVG sanitization tool before passing the SVG to SVGO.
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 svgo. Attackers reach the vulnerable code path via removeScripts without authentication.

Affected scope

Check the vendor advisory for the affected versions of svgo. Attack surface: removeScripts / href / removeScriptElement.

Severity

Severity: High (CVSS 8.2/10). Confidential information can be exposed externally.

How to fix

Update to 4.1.0.

Workaround

Workaround: For hostile input, use a dedicated SVG sanitization tool before passing the SVG to SVGO.

Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'svgo' . 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 exposureidentify
    grep -r 'svgo' . | grep -v node_modules

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

  2. 2
    Apply temporary workaroundmitigate
    For hostile input, use a dedicated SVG sanitization tool before passing the SVG to SVGO.

    パッチが適用されるまでの応急処置として、For hostile input, use a dedicated SVG sanitization tool before passing the SVG to SVGO. を実施。回避策の副作用 (機能低下) を確認した上で。

  3. 3
    Apply patchpatch
    Upgrade svgo to 4.1.0

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

  4. 4
    Post-deployment verificationverify
    Confirm patched version is live in production

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

Affected packages

PackageAffected → Fixed
npmsvgo
< 4.1.0→ 4.1.0

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

Summary

SVGO's opt-in removeScripts plugin failed to remove some executable links. Namespace-prefixed SVG anchors and URL schemes containing ASCII tabs or newlines could bypass its checks. Applications that used this plugin as their only protection for untrusted SVG input could expose users to cross-site scripting (XSS).

SVGO is an optimizer rather than a comprehensive sanitization library, but removeScripts is maintained for consumers that already rely on it to remove common script execution paths.

Details

Two related bypasses were present:

  1. The plugin inspected unprefixed SVG elements but did not recognize namespace-prefixed SVG anchors such as when the prefix was bound to the SVG namespace. Their executable href or namespaced *:href values remained intact.
  2. The URL check did not account for ASCII tab, line-feed, or carriage-return characters embedded in a scheme. Browsers remove these characters before parsing the scheme, so values such as java&#9;script: could remain executable after bypassing the plugin's javascript: check.

Anchors in unrelated custom namespaces are not executable SVG anchors and remain untouched.

Impact

If an application optimized attacker-controlled SVGs with removeScripts and then served the result in an active browser context, a victim could follow a link that executes script in the SVG's origin. Depending on the embedding and origin configuration, this could expose cookies or local storage, modify content, or…

Source: NIST National Vulnerability Database NVD GitHub Advisory

References

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