/

CVE-2026-73650

Severity:

HIGH RISK

(8.2)

Stored XSS (CWE-79) in SVGO SVG Sanitization Plugin

CVE-2026-73650

Deferred

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79, CWE-184

Impact:

Client-Side Code Execution and Sensitive Data Exposure

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SVGO's script-removal plugin can leave executable script content in optimized SVG files when script elements use namespaces or prefixes, and in some releases when JavaScript URIs use unexpected capitalization. If an application optimizes untrusted SVGs and serves the output, a victim who opens a crafted file may execute attacker-controlled script in the relevant browser context.

Affected context

The issue occurs in applications or processing pipelines that use SVGO's script-removal functionality to sanitize untrusted SVG input and then make the optimized result available to users. Risk is higher when the resulting SVG is served with an active content type, opened in a browser, or hosted within a security context that exposes application data such as cookies or local storage.

Exploit preconditions

  • Attack surface: SVG upload, transformation, storage, or content-serving functionality
  • Required access: Ability to submit or influence an SVG that is processed by SVGO
  • Trigger point: A user opens or renders the optimized SVG in a browser
  • Why exploitation is possible: The sanitizer may fail to recognize namespaced, prefixed, or case-variant executable content, allowing script-bearing markup or JavaScript URIs to survive optimization

Why this happens

The underlying bug is incomplete removal of executable SVG content. The filtering logic recognizes only a subset of equivalent element and URI representations, such as unprefixed script elements or case-specific JavaScript URI forms, rather than applying canonicalization and comprehensive validation before output.

This maps primarily to CWE-79: Improper Neutralization of Input During Web Page Generation, because attacker-controlled SVG content can be interpreted as script by a browser. It also relates to CWE-184: Incomplete List of Disallowed Inputs, since the sanitizer's removal rules do not cover all relevant representations of executable content.

Potential impact

  • A victim's browser may execute attacker-controlled JavaScript
  • Attackers may access data exposed to the SVG's execution context
  • Session information, local storage, or cookies may be exposed where browser policies permit
  • An attacker could alter the displayed SVG or perform actions using the victim's application context
  • The vulnerability could enable phishing or further client-side compromise through a trusted file-hosting domain

General mitigation guidance

Mitigation generally focuses on treating SVG as active content rather than relying on a narrow removal plugin as the sole security boundary.

Common defensive patterns include:

  • Use a maintained, security-focused SVG sanitizer that canonicalizes namespaces, element names, attributes, and URI schemes before applying allowlists
  • Prefer a strict allowlist of passive SVG elements and attributes, excluding scripts, event handlers, external references, and executable URI schemes
  • Avoid serving untrusted SVG with a browser-executable content type when rendering is not required
  • Store untrusted files on an isolated origin with no access to sensitive application cookies or local storage
  • Apply defense-in-depth browser controls, including an appropriate Content Security Policy
  • Validate the final serialized output after optimization rather than trusting only the input-stage checks
  • Process uploaded content with least privilege and prevent unintended network or filesystem access

How teams detect issues like this

Organizations can identify this issue through:

  • Static analysis and dependency review for SVG sanitization configurations and script-removal plugin usage
  • Code review checks for incomplete SVG allowlists, case-sensitive URI comparisons, and assumptions that optimization guarantees safety
  • Dynamic tests using namespaced and prefixed script elements, case variants of executable URI schemes, event attributes, and external references
  • Repository or CI policies requiring approved sanitizers and preventing untrusted SVG from being served as active browser content
  • Security monitoring for unexpected SVG uploads, browser execution from file-hosting origins, and suspicious script-like content in optimized output

Sources

SourceLink
github.comgithub.com/svg/svgo/commit/628e3bc7336625a30365d0a9b60185307d852466
github.comgithub.com/svg/svgo/commit/72a23886b4698b27624b936f3a15a80afd36d75f
github.comgithub.com/svg/svgo/commit/f529cfccc6c154d6f6eabe276ec637a8c5db6763
github.comgithub.com/svg/svgo/releases/tag/v2.8.3
github.comgithub.com/svg/svgo/releases/tag/v3.3.4
github.comgithub.com/svg/svgo/releases/tag/v4.0.2
github.comgithub.com/svg/svgo/security/advisories/GHSA-2p49-hgcm-8545

Frequently asked

questions

It can be exploited through an application's SVG upload or processing feature when an attacker can submit content that is later optimized and served to other users. The victim generally must open or render the resulting SVG.

Authentication depends on the application. An attacker needs whatever access is required to submit or influence an SVG, while the victim needs access to the resulting file.

Use a comprehensive allowlist-based SVG sanitizer with canonicalization, remove all active content, and serve untrusted files from an isolated origin when possible.

Test sanitizers against alternate namespaces, prefixes, casing, URI forms, event handlers, and external references. Combine content validation with safe hosting, restrictive browser policies, and least-privilege processing.

Find out what's already
exploitable in your codebase.