ZeroHour

CVE-2026-84370

mass

SVG XSS via incomplete link filtering in SVGO's removeScripts plugin

CVSS 3.1
8.2 high
EPSS
<1%p27
Published
()
Modified
AI analysis

CVE-2026-84370 is a cross-site scripting flaw (CWE-79/CWE-184) in the SVGO (SVG Optimizer) npm package, in the opt-in removeScripts plugin — named removeScriptElement in versions 2 and 3 — which incompletely filters executable links in plugins/removeScripts.js and lib/svgo/tools.js. The plugin fails to recognize namespace-prefixed anchor elements (such as svg:a with href or namespaced *:href values) and does not strip ASCII tab, line-feed, or carriage-return characters before checking URL schemes; because browsers remove those characters when parsing the scheme, a crafted executable link survives optimization. When an application processes attacker-controlled SVG with the plugin enabled and serves the result in an active browser context, a victim who activates the surviving link executes script in the SVG's origin, allowing data exposure, content modification, or actions performed as the victim. Any npm-based application, CLI workflow, or build pipeline using SVGO from version 1.0.0 up to the fixed versions with the plugin enabled is affected. Exploitation is not currently observed: the issue is not in CISA KEV, no public proof-of-concept is known, and EPSS estimates a 0.3% probability of exploitation in the next 30 days.

What to do: Upgrade SVGO to at least 2.8.4 on the 2.x line, 3.3.5 on the 3.x line, or 4.1.0 on the 4.x line. If upgrading is not immediate, disable the opt-in removeScripts/removeScriptElement plugin for untrusted SVG input, or avoid serving its output in an active browser context. Audit dependency and configuration files (e.g., imagemin/svgo wrappers) to find where the plugin is enabled implicitly, and run a dependency scan for vulnerable SVGO versions.

Affected
SVGO (npm) SVGO / SVG Optimizer>=1.0.0 and <2.8.4 (1.x and 2.x lines; plugin called removeScripts in 1.x and removeScriptElement in 2.x); fixed in 2.8.4
SVGO (npm) SVGO / SVG Optimizer3.x before 3.3.5 (removeScriptElement plugin); fixed in 3.3.5
SVGO (npm) SVGO / SVG Optimizer4.x before 4.1.0 (removeScripts plugin); fixed in 4.1.0
Estimated exposure
massmulti-million weekly npm downloads and plausibly 100,000+ downstream projects, though only those enabling the opt-in plugin on untrusted SVGs are exploitable — SVGO is one of npm's most widely downloaded SVG optimization packages (order-of-magnitude multi-million weekly downloads, common in build pipelines and image-optimizer tooling), putting the install base above 100k systems, but the…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

SVGO, short for SVG Optimizer, is a Node.js library and command-line application for optimizing SVG files. From version 1.0.0 until versions 2.8.4, 3.3.5, and 4.1.0, the opt-in removeScripts plugin, named removeScriptElement in versions 2 and 3, incompletely filters executable links in plugins/removeScripts.js and lib/svgo/tools.js. The plugin does not recognize namespace-prefixed SVG anchor elements such as svg:a with href or namespaced *:href values, and it does not remove ASCII tab, line-feed, or carriage-return characters before checking URL schemes. Browsers remove those characters before parsing a scheme, allowing an executable link to pass the plugin's check. When an application processes attacker-controlled SVG input and serves the result in an active browser context, a victim who activates the surviving link can execute script in the SVG's origin, expose data, modify content, or perform actions as the victim. This issue is fixed in versions 2.8.4, 3.3.5, and 4.1.0.

Ecosystems
npm
Weakness
CWE-79, CWE-184
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
GHSA
GHSA-w27v-7q3p-w38r (high)

In the news

No ingested article mentions this CVE yet.