CVE-2026-84369 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in svgo. A fix is available for svgo — see the affected versions and patch details below.
SVGO: removeScripts incompletely sanitizes executable HTML in SVG foreignObject elements
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-84369.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-84369 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 395,308 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
svgonpmDescription
Summary
SVGO's opt-in removeScripts plugin did not inspect executable HTML content inside SVG <foreignObject> elements. Applications that used this plugin as their only protection for untrusted SVG input could produce SVGs containing active HTML and 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
Although the plugin removed SVG and XHTML <script> elements, it left other HTML execution paths inside <foreignObject> unchanged. These included:
- event-handler attributes such as
onloadandonbeforetoggle; srcdocdocuments, including on<iframe>elements;- executable URLs in HTML attributes such as
action,data,formaction,href, andsrc.
An attacker could place one of these payloads in an SVG. If an application optimized the untrusted SVG with removeScripts and then served the result in an active browser context, the payload could execute in the viewer's origin.
Impact
Successful exploitation could allow script execution in the context where the optimized SVG is rendered. Depending on the embedding and origin configuration, this could expose cookies or local storage, modify content, or perform actions as the victim.
The plugin is opt-in, so consumers that do not enable removeScripts are not relying on the affected behavior. Typical local optimization of trusted SVG files is not affected.
Patches
Upgrade to one of the following releases for the maintained release line in use:
| Release line | Patched version | Plugin |
|---|---|---|
| v2 | 2.8.4 | removeScriptElement |
| v3 | 3.3.5 | removeScriptElement |
| v4 | 4.1.0 | removeScripts |
The fix preserves visual HTML inside SVG <foreignObject> elements while removing event attributes, srcdoc, and executable URL values from active HTML URL attributes.
SVGO v1 is no longer maintained. Users of v1 should upgrade to a supported release line.
Workarounds
For hostile input, use a dedicated SVG sanitization tool before passing the SVG to SVGO. As defense in depth, applications can reject or remove <foreignObject> content and avoid serving user-controlled SVGs in an active same-origin context.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | svgo | ≥ 1.0.0&&< 2.8.4 | 2.8.4npm install svgo@2.8.4 |
| 📦npm | svgo | ≥ 3.0.0&&< 3.3.5 | 3.3.5npm install svgo@3.3.5 |
| 📦npm | svgo | ≥ 4.0.0&&< 4.1.0 | 4.1.0npm install svgo@4.1.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for svgo, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update svgo to 2.8.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-84369 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2026-84369 in your dependencies?
Find it across npm, including transitive dependencies.