---
title: "GHSA-w27v-7q3p-w38r: SVGO: removeScripts allows executable links through namespace and control-character bypasses"
description: "High severity. SVGO: removeScripts allows executable links through namespace and control-character bypasses. Affects svgo; fixed in 4.1.0."
url: https://inlinr.com/advisories/GHSA-w27v-7q3p-w38r
lang: en
---

[Packages](https://inlinr.com/packages) / [svgo](https://inlinr.com/packages/svgo) / [Security](https://inlinr.com/packages/svgo/security)

High Vulnerability GHSA-w27v-7q3p-w38r CVE-2026-84370 Published 8 Sep 2026

# SVGO: removeScripts allows executable links through namespace and control-character bypasses

Your version 

Affected releases · [svgo](https://inlinr.com/packages/svgo)

- 4.x 4.0.0 – 4.0.2 Fixed in 4.1.0
- 3.x 3.0.0 – 3.3.4 Fixed in 3.3.5
- 2.x 2.0.0 – 2.8.3 Fixed in 2.8.4
- 1.x 1.0.0 – 1.3.2 No fix on this line yet

On 4.x, the newest line:

```
npm install svgo@4.1.0
```

Every release on a timeline

4.x 

1. Affected

4.0.0 – 4.0.2  
3 releases
2. Fixed

4.1.0  
1 release, latest

3.x 

1. Affected

3.0.0 – 3.3.4  
13 releases
2. Fixed

3.3.5  
1 release

2.x 

1. Affected

2.0.0 – 2.8.3  
19 releases
2. Fixed

2.8.4  
1 release

1.x 

1. Affected

1.0.0 – 1.3.2  
14 releases

107 stable releases of svgo, oldest to newest, one row per major.

## What happens

Summary

SVGO's opt-in `removeScripts` plugin failed to remove some executable links. Namespace-prefixed SVG anchors and URL schemes containing ASCII tabs or newlines could bypass its checks. Applications that used this plugin as their only protection for untrusted SVG input could expose users to cross-site scripting (XSS).

SVGO 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.

Details

Two related bypasses were present:

1. The plugin inspected unprefixed SVG `<a>` elements but did not recognize namespace-prefixed SVG anchors such as `<svg:a>` when the prefix was bound to the SVG namespace. Their executable `href` or namespaced `*:href` values remained intact.
2. The URL check did not account for ASCII tab, line-feed, or carriage-return characters embedded in a scheme. Browsers remove these characters before parsing the scheme, so values such as `java&#9;script:` could remain executable after bypassing the plugin's `javascript:` check.

Anchors in unrelated custom namespaces are not executable SVG anchors and remain untouched.

Impact

If an application optimized attacker-controlled SVGs with `removeScripts` and then served the result in an active browser context, a victim could follow a link that executes script in the SVG's origin. Depending on the embedding and origin configuration, this could expose cookies or local storage, modify content, or perform actions as the victim.

The plugin is opt-in, so consumers that do not enable it are not relying on the affected behavior. Typical local optimization of trusted SVG files is not affected.

Patches

Upgrade to one of the following releases for the maintained release line in use:

| Release line | Patched version | Plugin              |
| ------------ | --------------- | ------------------- |
| v2           | 2.8.4           | removeScriptElement |
| v3           | 3.3.5           | removeScriptElement |
| v4           | 4.1.0           | removeScripts       |

The fix makes SVG anchor handling namespace-aware and strips ASCII tabs, line feeds, and carriage returns before checking executable URL schemes.

SVGO v1 is no longer maintained. Users of v1 should upgrade to a supported release line.

Workarounds

For hostile input, use a dedicated SVG sanitization tool before passing the SVG to SVGO. Applications can also reject links from untrusted SVG input and avoid serving user-controlled SVGs in an active same-origin context.

References

- v4 fix: [#2268](https://github.com/svg/svgo/pull/2268 "https://github.com/svg/svgo/pull/2268")
- related executable URL hardening: [#2263](https://github.com/svg/svgo/pull/2263 "https://github.com/svg/svgo/pull/2263")
- v3 backport: [#2269](https://github.com/svg/svgo/pull/2269 "https://github.com/svg/svgo/pull/2269")
- v2 backport: [#2272](https://github.com/svg/svgo/pull/2272 "https://github.com/svg/svgo/pull/2272")
- v4.1.0 release: [github.com/svg/svgo/releases/tag/v4.1.0](https://github.com/svg/svgo/releases/tag/v4.1.0 "https://github.com/svg/svgo/releases/tag/v4.1.0")
- v3.3.5 release: [github.com/svg/svgo/releases/tag/v3.3.5](https://github.com/svg/svgo/releases/tag/v3.3.5 "https://github.com/svg/svgo/releases/tag/v3.3.5")
- v2.8.4 release: [github.com/svg/svgo/releases/tag/v2.8.4](https://github.com/svg/svgo/releases/tag/v2.8.4 "https://github.com/svg/svgo/releases/tag/v2.8.4")

## How it is exploited

Exploitable over the network, with no account and a user to do something.

- **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

## References

- [Reference](https://github.com/svg/svgo/security/advisories/GHSA-w27v-7q3p-w38r "https://github.com/svg/svgo/security/advisories/GHSA-w27v-7q3p-w38r")  
github.com/svg/svgo/security/advisories/GHSA-w2…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-84370 "https://nvd.nist.gov/vuln/detail/CVE-2026-84370")  
nvd.nist.gov/vuln/detail/CVE-2026-84370
- [Pull request](https://github.com/svg/svgo/pull/2268 "https://github.com/svg/svgo/pull/2268")  
#2268
- [Pull request](https://github.com/svg/svgo/pull/2269 "https://github.com/svg/svgo/pull/2269")  
#2269
- [Pull request](https://github.com/svg/svgo/pull/2272 "https://github.com/svg/svgo/pull/2272")  
#2272
- [Fix commit](https://github.com/svg/svgo/commit/0557385564a5c6c11d76cd934a6cff94451e532c "https://github.com/svg/svgo/commit/0557385564a5c6c11d76cd934a6cff94451e532c")  
0557385
- [Fix commit](https://github.com/svg/svgo/commit/3db3ef33e409a0bc0fdaf255e46c908b00e93bc2 "https://github.com/svg/svgo/commit/3db3ef33e409a0bc0fdaf255e46c908b00e93bc2")  
3db3ef3
- [Fix commit](https://github.com/svg/svgo/commit/994a9f00d79ddec68ce19a1ce9eb8ca08d747e4f "https://github.com/svg/svgo/commit/994a9f00d79ddec68ce19a1ce9eb8ca08d747e4f")  
994a9f0
- [Package](https://github.com/svg/svgo "https://github.com/svg/svgo")  
github.com/svg/svgo
- [Reference](https://github.com/svg/svgo/releases/tag/v2.8.4 "https://github.com/svg/svgo/releases/tag/v2.8.4")  
github.com/svg/svgo/releases/tag/v2.8.4
- [Reference](https://github.com/svg/svgo/releases/tag/v3.3.5 "https://github.com/svg/svgo/releases/tag/v3.3.5")  
github.com/svg/svgo/releases/tag/v3.3.5
- [Reference](https://github.com/svg/svgo/releases/tag/v4.1.0 "https://github.com/svg/svgo/releases/tag/v4.1.0")  
github.com/svg/svgo/releases/tag/v4.1.0

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
