CVE-2026-84369: SVGO RemoveScripts Incompletely Sanitizes Executable HTML Vulnerability
MODERATECVE-2026-84369 is a MODERATE (CVSS 6.1) removescripts incompletely sanitizes executable html vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting SVGO libraries in the npm ecosystem. The issue involves removescripts incompletely sanitizes executable html in svg foreignobject elements. Remediation is available by upgrading affected packages to version 2.8.4, 3.3.5, 4.1.0.
CVE-2026-84369 at a Glance
Security Impact
CVSS: 6.1
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:L/I:L/A:N).
How to Fix CVE-2026-84369
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.
npm install svgo@2.8.4
npm install svgo@3.3.5
npm install svgo@4.1.0
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-84369, 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.4), 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
CVE-2026-84369 Affected SVGO Versions
3 component(s)References
Frequently Asked Questions
What is CVE-2026-84369?
Which SVGO versions are affected?
What version fixes CVE-2026-84369?
Is svgo affected?
What is the CVSS score of CVE-2026-84369?
What CWE is associated with CVE-2026-84369?
How can I check npm dependencies for CVE-2026-84369?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4vpr-x523-8j87",
"modified" : "2026-09-08T21:20:05Z",
"published" : "2026-09-08T21:20:05Z",
"aliases" : [ "CVE-2026-84369" ],
"summary" : "SVGO: removeScripts incompletely sanitizes executable HTML in SVG foreignObject elements",
"details" : "## Summary\n\nSVGO's opt-in `removeScripts` plugin did not inspect executable HTML content inside SVG `<foreignObject>` elements. Applications that used this plugin as their only protection for untrusted SVG input could produce SVGs containing active HTML and expose users to cross-site scripting (XSS).\n\nSVGO is an optimizer rather than a comprehensive sanitization library, but `removeScripts` is maintained for consumers that already rely on it to remove common script execution paths.\n\n## Details\n\nAlthough the plugin removed SVG and XHTML `<script>` elements, it left other HTML execution paths inside `<foreignObject>` unchanged. These included:\n\n- event-handler attributes such as `onload` and `onbeforetoggle`;\n- `srcdoc` documents, including on `<iframe>` elements;\n- executable URLs in HTML attributes such as `action`, `data`, `formaction`, `href`, and `src`.\n\nAn attacker could place one of these payloads in an SVG. If an application optimized the untrusted SVG with `removeScripts` and then served the result in an active browser context, the payload could execute in the viewer's origin.\n\n## Impact\n\nSuccessful exploitation could allow script execution in the context where the optimized SVG is rendered. Depending on the embedding and origin configuration, this could expose cookies or local storage, modify content, or perform actions as the victim.\n\nThe plugin is opt-in, so consumers that do not enable `removeScripts` are not relying on the affected behavior. Typical local optimization of trusted SVG files is not affected.\n\n## Patches\n\nUpgrade to one of the following releases for the maintained release line in use:\n\n| Release line | Patched version | Plugin |\n| --- | --- | --- |\n| v2 | 2.8.4 | `removeScriptElement` |\n| v3 | 3.3.5 | `removeScriptElement` |\n| v4 | 4.1.0 | `removeScripts` |\n\nThe fix preserves visual HTML inside SVG `<foreignObject>` elements while removing event attributes, `srcdoc`, and executable URL values from active HTML URL attributes.\n\nSVGO v1 is no longer maintained. Users of v1 should upgrade to a supported release line.\n\n## Workarounds\n\nFor hostile input, use a dedicated SVG sanitization tool before passing the SVG to SVGO. As defense in depth, applications can reject or remove `<foreignObject>` content and avoid serving user-controlled SVGs in an active same-origin context.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "svgo"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "2.8.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "svgo"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.3.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "svgo"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/security/advisories/GHSA-4vpr-x523-8j87"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-84369"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/pull/2264"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/pull/2269"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/pull/2272"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/commit/0557385564a5c6c11d76cd934a6cff94451e532c"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/commit/994a9f00d79ddec68ce19a1ce9eb8ca08d747e4f"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/commit/fd51e474a300417d9361d9302d596b1763146327"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/svg/svgo"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/releases/tag/v2.8.4"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/releases/tag/v3.3.5"
}, {
"type" : "WEB",
"url" : "https://github.com/svg/svgo/releases/tag/v4.1.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-08T21:20:05Z",
"nvd_published_at" : "2026-09-01T21:18:48Z"
}
}