CVE-2026-84369: SVGO: removeScripts incompletely sanitizes executable HTML in SVG foreignObject elements

Published Sep 1, 2026
·
Updated

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 and implemented in plugins/removeScripts.js, removes SVG and XHTML script elements but does not inspect executable HTML content inside SVG foreignObject elements. Event-handler attributes such as onload and onbeforetoggle, srcdoc documents, and executable URLs in the action, data, formaction, href, and src attributes can remain in attacker-controlled SVG input. When an application uses the plugin as its only protection and serves the optimized SVG in an active browser context, the payload can execute script in the viewer'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.

Affected Software

2 affected components
npm/svgo>1.0.0<2.8.4, >2.8.4<3.3.5, >3.3.5<4.1.0
npm/svgo<2.8.3, >=2.8.4<3.3.4, >=3.3.5<4.0.9, <4.0.9

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.8.4
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.3.5
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 4.1.0

Event History

Sep 1, 2026
CVE Published
via MITRE·08:43 PM
Data Sourced
via MITRE·08:43 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments are exposed when they process attacker-controlled SVGs with SVGO's opt-in removeScripts plugin as the only safeguard and then serve the optimized SVG in an active browser context. The issue affects versions from 1.0.0 up to, but not including, 2.8.4, 3.3.5, and 4.1.0.

2

What does an attacker need to exploit it?

An attacker needs to supply an SVG that is processed by the affected plugin and later rendered in an active browser context. The malicious content can be placed in HTML within an SVG foreignObject element, including event-handler attributes, srcdoc documents, or executable URLs in action, data, formaction, href, or src attributes.

3

Are default SVGO configurations affected?

The vulnerable removeScripts plugin is opt-in, so the provided data does not indicate that installations not using this plugin are affected by this specific flaw. Exposure specifically depends on relying on the plugin as the only protection for untrusted SVG input.

4

What should be done if upgrades cannot happen immediately?

Do not rely on removeScripts alone to sanitize attacker-controlled SVG files. Avoid serving optimized untrusted SVGs in an active browser context until upgrading to 2.8.4, 3.3.5, or 4.1.0.

5

How can teams determine whether they may already be affected?

Check whether the application uses SVGO versions earlier than 2.8.4, 3.3.5, or 4.1.0 and enables removeScripts or removeScriptElement. Then determine whether untrusted SVG input can contain foreignObject elements and is served where a browser may execute active content under the viewer's origin.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203