{"id":"CVE-2026-84370","kind":"vulnerability","aliases":["CVE-2026-84370","GHSA-w27v-7q3p-w38r"],"related":[],"title":"SVGO: removeScripts allows executable links through namespace and control-character bypasses","description":"## Summary\n\nSVGO'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).\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\nTwo related bypasses were present:\n\n1. 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.\n2. 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.\n\nAnchors in unrelated custom namespaces are not executable SVG anchors and remain untouched.\n\n## Impact\n\nIf 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.\n\nThe 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.\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 makes SVG anchor handling namespace-aware and strips ASCII tabs, line feeds, and carriage returns before checking executable URL schemes.\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. Applications can also reject links from untrusted SVG input and avoid serving user-controlled SVGs in an active same-origin context.\n\n## References\n\n- v4 fix: https://github.com/svg/svgo/pull/2268\n- related executable URL hardening: https://github.com/svg/svgo/pull/2263\n- v3 backport: https://github.com/svg/svgo/pull/2269\n- v2 backport: https://github.com/svg/svgo/pull/2272\n- v4.1.0 release: https://github.com/svg/svgo/releases/tag/v4.1.0\n- v3.3.5 release: https://github.com/svg/svgo/releases/tag/v3.3.5\n- v2.8.4 release: https://github.com/svg/svgo/releases/tag/v2.8.4","summary":"SVGO's opt-in removeScripts plugin leaves some executable SVG links in place when the anchor uses a namespace prefix or the URL scheme contains tab or newline characters. If an application optimizes untrusted SVGs with this plugin and serves the output in an active browser context, a victim who follows a link can run script in the SVG's origin.","severity":"high","cvss":8.2,"epss":0.00525,"exploited":false,"exploited_at":null,"products":[{"name":"svgo","fixed":["2.8.4"],"affected":">= 1.0.0, < 2.8.4","ecosystem":"npm"},{"name":"svgo","fixed":["3.3.5"],"affected":">= 3.0.0, < 3.3.5","ecosystem":"npm"},{"name":"svgo","fixed":["4.1.0"],"affected":">= 4.0.0, < 4.1.0","ecosystem":"npm"}],"ecosystems":["npm"],"tags":["cwe-184","cwe-79","node","npm","package","svg-upload","svgo","web-apps"],"not_affected_if":["default-config","plugin-not-enabled","trusted-input-only"],"how_to_check":"- Run `npm ls svgo` to list the installed SVGO versions and find which ones are below `2.8.4`, `3.3.5` or `4.1.0`.\n- Search the project for `removeScripts` or `removeScriptElement` to see whether the plugin is enabled in the SVGO config.\n- Check whether untrusted SVG uploads are optimized with SVGO and then served from the same origin as the app.","fix":"- Upgrade SVGO to `2.8.4` on the v2 line, `3.3.5` on the v3 line, or `4.1.0` on the v4 line.\n- Upgrade off SVGO v1, which is no longer maintained.\n- For hostile input, run a dedicated SVG sanitizer before SVGO, or reject links from untrusted SVG input.","status":"open","published_at":"2026-09-01T21:18:48+00:00","first_seen_at":"2026-10-26T23:54:12+00:00","triaged_at":"2026-10-26T23:55:04+00:00","updated_at":"2026-10-26T23:55:48+00:00","category":"package","confidence":0.85,"triage":{"at":"2026-10-26T23:55:04Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade SVGO to `2.8.4` on the v2 line, `3.3.5` on the v3 line, or `4.1.0` on the v4 line.\n- Upgrade off SVGO v1, which is no longer maintained.\n- For hostile input, run a dedicated SVG sanitizer before SVGO, or reject links from untrusted SVG input.","reach":"internet","title":"SVGO: removeScripts misses namespaced anchors and tab-split javascript URLs","impact":"medium","summary":"SVGO's opt-in removeScripts plugin leaves some executable SVG links in place when the anchor uses a namespace prefix or the URL scheme contains tab or newline characters. If an application optimizes untrusted SVGs with this plugin and serves the output in an active browser context, a victim who follows a link can run script in the SVG's origin.","category":"package","nicknames":[],"who_cares":["npm","svgo","node","web-apps","svg-upload"],"confidence":0.85,"needs_auth":"unknown","worst_case":"Victim clicks a crafted SVG link and script runs in the app's origin","analyst_note":"","how_to_check":"- Run `npm ls svgo` to list the installed SVGO versions and find which ones are below `2.8.4`, `3.3.5` or `4.1.0`.\n- Search the project for `removeScripts` or `removeScriptElement` to see whether the plugin is enabled in the SVGO config.\n- Check whether untrusted SVG uploads are optimized with SVGO and then served from the same origin as the app.","needs_analyst":false,"not_affected_if":["default-config","trusted-input-only","plugin-not-enabled"],"who_is_affected":"Applications that run SVGO's removeScripts (or removeScriptElement on v2 and v3) over attacker-controlled SVG files and then serve the result in an active browser context are exposed. The plugin is opt-in, so projects that do not enable it are not relying on the affected behavior. Typical local optimization of trusted SVG files is not affected.","user_interaction":"yes","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000812,"input_tokens":4427,"output_tokens":738,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-184':28B '-2026':14A,22A '-79':30B '-84370':15A,23A '/svg/svgo/pull/2263':490C '/svg/svgo/pull/2268':483C '/svg/svgo/pull/2269':495C '/svg/svgo/pull/2272':500C '/svg/svgo/releases/tag/v2.8.4':515C '/svg/svgo/releases/tag/v3.3.5':510C '/svg/svgo/releases/tag/v4.1.0':505C '1':189C '2':225C '2.8.4':392C '3.3.5':395C '4.1.0':398C '7q3p':19A 'account':231C 'action':337C 'activ':86B,302C,473C 'affect':359C,370C 'allow':3A 'alreadi':173C 'also':457C 'anchor':57B,121C,204C,271C,280C,404C 'app':40B 'applic':73B,134C,287C,455C 'ascii':126C,233C,411C 'attack':290C 'attacker-control':289C 'avoid':465C 'awar':408C 'backport':492C,497C 'behavior':360C 'bound':211C 'browser':87B,247C,303C 'bypass':12A,131C,186C,265C 'carriag':240C,416C 'carriage-return':239C 'charact':11A,70B,242C,250C 'check':133C,228C,270C,419C 'common':179C 'comprehens':163C 'configur':325C 'consum':171C,348C 'contain':66B,125C 'content':334C 'context':88B,304C,477C 'control':10A,291C,469C 'control-charact':9A 'cooki':329C 'could':130C,147C,261C,307C,327C 'cross':152C 'cross-sit':151C 'custom':274C 'cve':13A,21A 'cwe':27B,29B 'dedic':445C 'depend':319C 'detail':183C 'element':195C 'embed':243C,322C 'enabl':352C 'execut':4A,50B,115C,181C,217C,263C,278C,312C,420C,485C 'expos':148C,328C 'fail':111C 'feed':237C,414C 'file':367C 'fix':401C,480C 'follow':92B,308C,377C 'ghsa':17A 'ghsa-w27v-7q3p-w38r':16A 'github.com':482C,489C,494C,499C,504C,509C,514C 'github.com/svg/svgo/pull/2263':488C 'github.com/svg/svgo/pull/2268':481C 'github.com/svg/svgo/pull/2269':493C 'github.com/svg/svgo/pull/2272':498C 'github.com/svg/svgo/releases/tag/v2.8.4':513C 'github.com/svg/svgo/releases/tag/v3.3.5':508C 'github.com/svg/svgo/releases/tag/v4.1.0':503C 'handl':405C 'harden':487C 'hostil':441C 'href':218C,221C 'impact':284C 'input':146C,442C,463C 'inspect':192C 'intact':224C 'java':259C 'javascript':269C 'leav':48B 'librari':165C 'line':236C,383C,387C,413C,438C 'line-fe':235C 'link':5A,52B,94B,116C,310C,459C 'local':331C,362C 'longer':427C 'maintain':169C,381C,428C 'make':402C 'modifi':333C 'namespac':7A,60B,118C,201C,215C,220C,275C,407C 'namespace-awar':406C 'namespace-prefix':117C,200C 'newlin':69B,129C 'node':31B 'npm':32B 'one':374C 'opt':44B,107C,345C 'opt-in':43B,106C,344C 'optim':74B,159C,288C,363C 'origin':102B,318C,324C,476C 'output':83B 'packag':33B 'pars':252C 'pass':450C 'patch':371C,388C 'path':182C 'perform':336C 'place':54B 'plugin':47B,79B,110C,138C,191C,267C,342C,390C 'prefix':61B,119C,202C,209C 'present':188C 'protect':142C 'rather':160C 'recogn':199C 'refer':478C 'reject':458C 'relat':185C,484C 'releas':378C,382C,386C,437C,502C,507C,512C 'reli':174C,356C 'remain':223C,262C,282C 'remov':113C,178C,248C 'removescript':2A,46B,109C,167C,294C,399C 'removescriptel':393C,396C 'result':299C 'return':241C,417C 'run':96B 'same-origin':474C 'sanit':164C,447C 'scheme':65B,124C,246C,254C,422C 'script':97B,154C,180C,260C,313C 'serv':81B,297C,466C 'site':153C 'storag':332C 'strip':410C 'summari':103C 'support':436C 'svg':35B,51B,100B,120C,145C,194C,203C,214C,279C,316C,366C,403C,446C,452C,462C 'svg-upload':34B 'svgo':1A,24A,25A,26A,37B,41B,104C,156C,423C,454C 'svgs':76B,292C,470C 'tab':67B,127C,234C,412C 'tool':448C 'trust':365C 'two':184C 'typic':361C 'unprefix':193C 'unrel':273C 'untouch':283C 'untrust':75B,144C,461C 'upgrad':372C,433C 'upload':36B 'url':64B,123C,227C,421C,486C 'use':58B,136C,385C,443C 'user':149C,429C,468C 'user-control':467C 'v1':424C,431C 'v2':391C,496C 'v2.8.4':511C 'v3':394C,491C 'v3.3.5':506C 'v4':397C,479C 'v4.1.0':501C 'valu':222C,256C 'version':389C 'victim':90B,306C,340C 'w27v':18A 'w38r':20A 'web':39B 'web-app':38B 'workaround':439C 'xss':155C","nicknames":[],"mitigations":[],"who_affected":"Applications that run SVGO's removeScripts (or removeScriptElement on v2 and v3) over attacker-controlled SVG files and then serve the result in an active browser context are exposed. The plugin is opt-in, so projects that do not enable it are not relying on the affected behavior. Typical local optimization of trusted SVG files is not affected.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-09-01T21:18:48+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-w27v-7q3p-w38r","url":"https://github.com/advisories/GHSA-w27v-7q3p-w38r","severity":"high","published_at":"2026-09-08T21:20:28+00:00","modified_at":"2026-10-26T23:52:17+00:00","first_seen_at":"2026-10-26T23:54:12+00:00","fetched_at":"2026-10-27T04:03:42+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-84370","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84370","severity":null,"published_at":"2026-09-01T21:18:48+00:00","modified_at":"2026-09-09T21:09:13+00:00","first_seen_at":"2026-10-26T23:55:48+00:00","fetched_at":"2026-10-26T23:55:48+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}