Intel

AIKIDO-2026-676071

svgo is vulnerable to Cross-Site Scripting (XSS)

Cross-Site Scripting (XSS)GHSA-4vpr-x523-8j87 Published Yesterday

61

Medium Risk

This Affects:

JSsvgo
1.0.0 - 2.8.3
Fixed in 2.8.4
3.0.0 - 3.3.4
Fixed in 3.3.5
4.0.0 - 4.0.2
Fixed in 4.1.0
Are you affected? Scan for Free

TL;DR

The opt-in removeScripts plugin strips <script> elements but does not fully sanitize executable HTML inside SVG <foreignObject> containers. Event-handler attributes such as onload, srcdoc documents on embedded iframes, and executable URLs in attributes like href, src, and action survive optimization. When the optimized SVG is rendered in an active browser context, that executable content runs as cross-site script. The fix removes SVG event attributes and strips executable HTML URLs and embedded documents inside foreignObject.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you enable the opt-in removeScripts plugin (named removeScriptElement on the v1-v2 lines) to sanitize untrusted SVG input.

Background info

svgo is vulnerable to Cross-Site Scripting (XSS) in versions 1.0.0 - 2.8.3, 3.0.0 - 3.3.4 and 4.0.0 - 4.0.2.

How to fix this

Upgrade the svgo library to the patch version.