svgo is vulnerable to Cross-Site Scripting (XSS)
61
Medium Risk
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.
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.
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.
Upgrade the svgo library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant