svgo
4.1.0 · 24 Aug 2026MIT52.3M / weekRepositoryHomepagenpmAtom feed
Upgrading svgo From 4.0.0 to 4.1.0
3 releases in betweenevery note read
Reading releases, release notes and advisories…
- 0
- changes to make
- 4
- advisories fixed
- 3
- new
- 7
- fixes
Security
Fixes 4 advisories affecting 4.0.0
- SVGO removeScripts plugin leaves some executable scripts intacthigh · GHSA-2p49-hgcm-8545
- SVGO: removeScripts incompletely sanitizes executable HTML in SVG foreignObject elementsmoderate · GHSA-4vpr-x523-8j87
- SVGO: removeScripts allows executable links through namespace and control-character bypasseshigh · GHSA-w27v-7q3p-w38r
- SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)high · GHSA-xpqw-6gx7-v673
- 4.1.0
It also includes important security hardening for
removeScripts, dependency updates, and improvements to the test and regression infrastructure. - 4.1.0
Filters executable
data:URLs containing HTML, XHTML, or SVG documents while preserving inert data such as PNG images, and filters legacyvbscript:URLs (#2263). - 4.1.0
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). - 4.1.0
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). - 4.1.0
- 4.1.0
- 4.0.2
removeScripts, remove JavaScript URIs case-insensitively and make
<script>handling namespace aware.
Release by release
- Security
It also includes important security hardening for
removeScripts, dependency updates, and improvements to the test and regression infrastructure. - 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). - Security
- Security
- Security
- Security
removeScripts, remove JavaScript URIs case-insensitively and make
<script>handling namespace aware. - New
mergePaths, speed up child node removal.
- Fixed
convertColors, skip case-normalization for CSS custom properties.
- Fixed
convertPathData, improve handling of consecutive
tcommands. - Fixed
convertPathData, safer handling of paths.
- Fixed
Improve parsing of negative (or +) arc radii.
- Fixed
When converting to a data URI, only encode it as a data URI once.
- Security
- New
convertPathData, refactor to reduce redundant equality checks.
- New
removeHiddenElems, compute styles lazily.
- Fixed
removeEmptyContainers, removed leftover
<use>elements referencing an empty container that were removed. - Fixed
removeUnknownsAndDefaults, don't remove attributes if they're referenced in attribute selectors (CSS).
- New
6 other lines we could not sort, mostly version bumps
- 4.1.0
Disallowed control characters such as
,, and; - 4.1.0
UTF-16 surrogate code points such as
�; - 4.1.0
Invalid XML code points such as
. - 4.0.2
removeAttributesBySelector, log warning and noop if missing parameters.
- 4.0.1
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. - 4.0.1
Plugin/preset types to enforce the name start with
preset-if it is a preset (collection of plugins).
2 internal lines (docs, tests, tooling) left out.
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.