Cross-Site Scripting (XSS) in svgo
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.
Cross-site scripting (XSS) (CWE-79) exists in svgo. Attackers reach the vulnerable code path via removeScripts without authentication.
Check the vendor advisory for the affected versions of svgo. Attack surface: removeScripts / href / removeScriptElement.
Severity: High (CVSS 8.2/10). Confidential information can be exposed externally.
Update to 4.1.0.
Workaround: For hostile input, use a dedicated SVG sanitization tool before passing the SVG to SVGO.
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
Identify exposureidentify
grep -r 'svgo' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
svgoを grep し、稼働しているサービス・バージョンを把握する。 -
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
Apply patchpatch
Upgrade svgo to 4.1.0ステージング環境で 4.1.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4
Post-deployment verificationverify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| npmsvgo |
< 4.1.0→ 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.
- Debian DEBIAN-CVE-2026-84370 node-svgo Fix available
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:
- The plugin inspected unprefixed SVG
elements but did not recognize namespace-prefixed SVG anchors such aswhen the prefix was bound to the SVG namespace. Their executablehrefor namespaced*:hrefvalues remained intact. - 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	script:could remain executable after bypassing the plugin'sjavascript: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
- advisory github.com
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com