Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

SVGO removeScripts plugin leaves some executable scripts intact

0
High
Published: 07/21/2026 (07/21/2026, 19:42:04 UTC)
Source: GCVE Database
Product: svgo

Description

SVGO's removeScripts plugin, which is disabled by default, fails to remove all executable scripts from SVG files in certain cases. Specifically, it does not remove namespaced or prefixed <script> elements (e.g., <svg:script>) and matches JavaScript URIs case-sensitively instead of case-insensitively. This can leave executable scripts intact, potentially enabling cross-site scripting (XSS) if untrusted SVGs are processed with this plugin and served to users. SVGO patched these issues in versions 3.3.4 and 4.0.2. Users relying on this plugin for sanitization should upgrade or use dedicated SVG sanitization tools.

CVSS v3.1

Score 8.2high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N

Affected software

npmghsa
svgo
Affected versions
>=1.0.0 <2.8.3
npmghsa
svgo
Affected versions
>=3.0.0 <3.3.4
npmghsa
svgo
Affected versions
>=4.0.0 <4.0.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/22/2026, 00:55:57 UTC

Technical Analysis

The SVGO removeScripts plugin is intended to remove script elements, JavaScript URIs, and event handlers from SVG files to reduce XSS risk. However, it did not handle namespaced or prefixed <script> elements, such as <svg:script>, leaving them intact. Additionally, it matched JavaScript URIs case-sensitively, missing variants with different casing. These shortcomings mean that some executable scripts could remain in SVGs after optimization, posing an XSS risk if untrusted SVGs are processed and served. The issue affects SVGO versions >=1.0.0 <2.8.3, >=3.0.0 <3.3.4, and >=4.0.0 <4.0.2. Patches are available in versions 2.8.3, 3.3.4, and 4.0.2, which improve namespace-aware handling and case-insensitive URI matching. Users are advised to upgrade or use dedicated SVG sanitization tools before SVGO processing.

Potential Impact

If SVGO's removeScripts plugin is used on untrusted SVG input, some executable scripts may remain due to incomplete script removal. This can lead to cross-site scripting (XSS) vulnerabilities if the SVG is served to other users on the same domain, potentially allowing script execution that can access cookies or local storage. The vulnerability affects multiple SVGO versions before the patches. Users who only use SVGO locally on trusted SVGs or in build pipelines are unlikely to be impacted.

Mitigation Recommendations

Fixes for this vulnerability are available in SVGO versions 2.8.3, 3.3.4, and 4.0.2. Users should upgrade to at least these versions to ensure complete removal of executable scripts by the removeScripts plugin. If upgrading is not possible, users should consider using dedicated SVG sanitization tools prior to SVGO processing. The removeScripts plugin is disabled by default, so users relying on it for sanitization should verify their configurations. No additional action is required if the plugin is not enabled or if SVGs are trusted.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-2p49-hgcm-8545
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a600ac39c2644c7f8fe33b3

Added to database: 07/22/2026, 00:11:47 UTC

Last enriched: 07/22/2026, 00:55:57 UTC

Last updated: 07/31/2026, 12:28:12 UTC

Views: 31

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses