CVE-2026-73650: Svgo SVGO RemoveScripts Plugin Leaves Some Vulnerability

HIGH
Advisory Identifier: GHSA-2p49-hgcm-8545
CVSS 8.2
CWE-79 CWE-184
Published
Advisory Summary

CVE-2026-73650 is a HIGH (CVSS 8.2) svgo removescripts plugin leaves some vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Svgo libraries in the npm ecosystem. The issue involves svgo removescripts plugin leaves some executable scripts intact. Remediation is available by upgrading affected packages to version 2.8.3, 3.3.4, 4.0.2.

CVE-2026-73650 at a Glance

CVE Identifier CVE-2026-73650
GHSA Identifier GHSA-2p49-hgcm-8545
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Svgo
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N).

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

How to Fix CVE-2026-73650

To remediate this vulnerability, upgrade all affected Svgo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

svgo fixed: 2.8.3
npm install svgo@2.8.3
svgo fixed: 3.3.4
npm install svgo@3.3.4
svgo fixed: 4.0.2
npm install svgo@4.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls svgo

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-73650, inspect your project dependencies using npm:

npm ls svgo

Analyze the terminal output to locate any version of Svgo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.3), your application is affected.

Note: The npm ls svgo command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Svgo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS. ### Details SVGO has a plugin for removing scripts from an SVG, which removes: - `<script>` elements - JavaScript URIs (v4 and v3 only) - `on…` event handlers (v4 and v3 only) While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose. However, there were two problems: - SVGO did not check namespaced/prefixed `script` elements, for example if one declared an explicit prefix for the SVG namespace ( `<svg:script>`) instead of using the default namespace ( `<script>`), the `<svg:script>` tag would be left intact. - SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive. #### Proof of Concept ```js import { optimize } from 'svgo'; /** Presume that this string was obtained in some other way, such as network. */ const original = ` <svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"> <a uwu:href="JavaScript:(() =&gt; { alert(document.cookie) })();"><text y="30">uwu</text></a> <svg:script> alert(document.cookie); </svg:script> </svg> `; optimize(original, { plugins: ['removeScripts'] }); // Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers. ``` ### Impact If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies. This may affect you if you have enabled one of the following: | SVGO Version | Plugin Name | |---|---| | v4 | removeScripts | | v3 | removeScriptElement | | v2 | removeScriptElement | | v1 | removeScriptElement | It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines. ### Patches #### >= 3.0.0, <= 4.0.1 SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example: ```sh yarn up svgo # or if SVGO is a nested dependency yarn up -R svgo ``` The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called `<*:script>` which clients shouldn't treat as executable. #### >= 2.0.0, <= 2.8.2 SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove `<script>` elements and nothing more. It has the namespace aware handling for tags like `<svg:script>` or `<xhtml:script>`, but has **_not_** been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end. #### >= 1.0.0, <= 1.3.2 SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble. ### Workarounds If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

CVE-2026-73650 Affected Svgo Versions

3 component(s)
Fixed Versions:
2.8.33.3.44.0.2
Product / Package Ecosystem Affected Versions Fixed Version
svgo
npm
≥ 1.0.0
< 2.8.3
2.8.3
svgo
npm
≥ 3.0.0
< 3.3.4
3.3.4
svgo
npm
≥ 4.0.0
< 4.0.2
4.0.2

References

Frequently Asked Questions

What is CVE-2026-73650?
CVE-2026-73650 is a security vulnerability in Svgo involving SVGO removeScripts plugin leaves some executable scripts intact under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Svgo versions are affected?
Affected versions include releases prior to 2.8.3, 3.3.4, 4.0.2 across affected packages: svgo.
What version fixes CVE-2026-73650?
Upgrading to 2.8.3, 3.3.4, 4.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is svgo affected?
Yes, svgo is affected in releases prior to 2.8.3, 3.3.4, 4.0.2. Upgrade your dependency to 2.8.3, 3.3.4, 4.0.2 or later.
What is the CVSS score of CVE-2026-73650?
CVE-2026-73650 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2026-73650?
CVE-2026-73650 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-73650?
Run the dependency tree command: 'npm ls svgo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2p49-hgcm-8545",
  "modified" : "2026-08-13T18:08:43Z",
  "published" : "2026-07-21T19:42:04Z",
  "aliases" : [ "CVE-2026-73650" ],
  "summary" : "SVGO removeScripts plugin leaves some executable scripts intact",
  "details" : "### Summary\n\nSVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.\n\n### Details\n\nSVGO has a plugin for removing scripts from an SVG, which removes:\n\n- `<script>` elements\n- JavaScript URIs (v4 and v3 only)\n- `on…` event handlers (v4 and v3 only)\n\nWhile SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.\n\nHowever, there were two problems:\n\n- SVGO did not check namespaced/prefixed `script` elements, for example if one declared an explicit prefix for the SVG namespace ( `<svg:script>`) instead of using the default namespace ( `<script>`), the `<svg:script>` tag would be left intact.\n- SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.\n\n#### Proof of Concept\n\n```js\nimport { optimize } from 'svgo';\n\n/** Presume that this string was obtained in some other way, such as network. */\nconst original = `\n  <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns:uwu=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 100 100\" version=\"1.1\">\n    <a uwu:href=\"JavaScript:(() =&gt; { alert(document.cookie) })();\"><text y=\"30\">uwu</text></a>\n    <svg:script>\n      alert(document.cookie);\n    </svg:script>\n  </svg>\n`;\n\noptimize(original, {\n  plugins: ['removeScripts']\n});\n// Did not remove <svg:script> or uwu:href=\"JavaScript:…—still executed by browsers.\n```\n\n### Impact\n\nIf you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.\n\nThis may affect you if you have enabled one of the following:\n\n| SVGO Version | Plugin Name |\n|---|---|\n| v4 | removeScripts |\n| v3 | removeScriptElement |\n| v2 | removeScriptElement |\n| v1 | removeScriptElement |\n\nIt's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.\n\n### Patches\n\n#### >= 3.0.0, <= 4.0.1\n\nSVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:\n\n```sh\nyarn up svgo\n\n# or if SVGO is a nested dependency\nyarn up -R svgo\n```\n\nThe proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called `<*:script>` which clients shouldn't treat as executable. \n\n#### >= 2.0.0, <= 2.8.2\n\nSVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove `<script>` elements and nothing more. It has the namespace aware handling for tags like `<svg:script>` or `<xhtml:script>`, but has **_not_** been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.\n\n#### >= 1.0.0, <= 1.3.2\n\nSVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.\n\n### Workarounds\n\nIf your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "svgo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "2.8.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "svgo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.3.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "svgo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/svg/svgo/security/advisories/GHSA-2p49-hgcm-8545"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/svg/svgo/commit/628e3bc7336625a30365d0a9b60185307d852466"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/svg/svgo/commit/72a23886b4698b27624b936f3a15a80afd36d75f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/svg/svgo/commit/f529cfccc6c154d6f6eabe276ec637a8c5db6763"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/svg/svgo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/svg/svgo/releases/tag/v2.8.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/svg/svgo/releases/tag/v3.3.4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/svg/svgo/releases/tag/v4.0.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-184", "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-21T19:42:04Z",
    "nvd_published_at" : null
  }
}