svgo
4.1.0 · 24 Aug 2026MIT52.3M / weekRepositoryHomepagenpmAtom feed
Where each line stands
Plan an upgradeLatest releases
All 107 releases- 4.x · latest line
4.1.0
24 Aug 2026- Security
Filters executable
data:URLs containing HTML, XHTML, or SVG documents while preserving inert data such as PNG images, and filters legacyvbscript:URLs (#2263). - Security
Sanitizes content inside SVG
<foreignObject>elements by removing HTML event-handler attributes,srcdoc, and executable URLs fromaction,data,formaction,href, andsrc, while preserving non-executable HTML and visual content (#2264). - Security
Recognizes namespace-prefixed SVG
<a>elements and removes ASCII tabs and newlines before checking URL schemes, preventing values such asjava	script:from bypassing detection while preserving elements in unrelated custom namespaces (#2268).
This minor release upgrades the SAX parser and introduces stricter XML validation. It also includes important security hardening for
removeScripts, dependency updates, and improvements to the test and regression infrastructure.Support SVGO
If SVGO is valuable to you or your organization, please consider supporting the project on OpenCollective. Your sponsorship helps fund ongoing maintenance and security work.
Stricter XML validation
SVGO now uses
sax1.6.1, upgraded from 1.5.0 (#2257).The new parser version validates numeric character references against the ranges permitted by XML. Invalid references are now rejected in both text and attributes, including:
Disallowed control characters such as
,, and;UTF-16 surrogate code points such as
�;Invalid XML code points such as
.
Valid boundary values—including
U+0020,U+D7FF,U+E000,U+FFFD, and characters throughU+10FFFF—remain supported.Parser failures are consistently exposed as
SvgoParserErrorerrors with anInvalid character entityreason.This is an intentional behavior change: malformed SVGs that were previously accepted may now produce a parser error, while valid XML documents are unaffected.
Security
The
removeScriptsplugin has been hardened against several script-execution bypasses:- Security
Filters executable
data:URLs containing HTML, XHTML, or SVG documents while preserving inert data such as PNG images, and filters legacyvbscript:URLs (#2263). - Security
Sanitizes content inside SVG
<foreignObject>elements by removing HTML event-handler attributes,srcdoc, and executable URLs fromaction,data,formaction,href, andsrc, while preserving non-executable HTML and visual content (#2264). - Security
Recognizes namespace-prefixed SVG
<a>elements and removes ASCII tabs and newlines before checking URL schemes, preventing values such asjava	script:from bypassing detection while preserving elements in unrelated custom namespaces (#2268).
These changes address:
- Security
- Security
Project maintenance
@TrySound is back as an active SVGO maintainer.
Many thanks to @KTibow, @SethFalco, and @XhmikosR for maintaining and improving SVGO over the past several years.
4.0.2
11 Jul 2026- Security
removeScripts, remove JavaScript URIs case-insensitively and make
<script>handling namespace aware. convertColors, skip case-normalization for CSS custom properties.
convertPathData, improve handling of consecutive
tcommands.
What's Changed
Security
- Security
removeScripts, remove JavaScript URIs case-insensitively and make
<script>handling namespace aware.
Bug Fixes
convertColors, skip case-normalization for CSS custom properties.
convertPathData, improve handling of consecutive
tcommands.convertPathData, safer handling of paths.
Improve parsing of negative (or +) arc radii.
When converting to a data URI, only encode it as a data URI once.
Performance
mergePaths, speed up child node removal.
Other Changes
removeAttributesBySelector, log warning and noop if missing parameters.
4.0.1
4 Mar 2026removeEmptyContainers, removed leftover
<use>elements referencing an empty container that were removed.removeUnknownsAndDefaults, don't remove attributes if they're referenced in attribute selectors (CSS).
convertPathData, refactor to reduce redundant equality checks.
What's Changed
Bug Fixes
removeEmptyContainers, removed leftover
<use>elements referencing an empty container that were removed.removeUnknownsAndDefaults, don't remove attributes if they're referenced in attribute selectors (CSS).
Performance
convertPathData, refactor to reduce redundant equality checks.
removeHiddenElems, compute styles lazily.
Other Changes
Plugins no longer include if they are enabled or disabled by default, as this was written inconsistently. The
--show-pluginsargument appends the presets a plugin is in to the end of the line.Plugin/preset types to enforce the name start with
preset-if it is a preset (collection of plugins).
Metrics
Before and after of the browser bundle of each respective version:
v4.0.0 v4.0.1 Delta svgo.browser.js 780.2 kB 781.5 kB ⬆️ 1.3 kB
Dependency tracking
Know when your own dependencies move
svgo had 4 security advisories in the last 12 months. inlinr emails you the day one touches a project of yours, with the version that fixes it.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Reading releases, release notes and advisories…
Registry facts last checked 21 Nov 2026. Releases and advisories last read 21 Nov 2026.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.