svgo
4.1.0 · 24 Aug 2026MIT52.3M / weekRepositoryHomepagenpmAtom feed
3.3.5 is the newest release of 3.x.
In short
6 fixed1 changed
Security
4 advisories affect 3.1.0; 3.3.5 fixes them
- HighSVGO: removeScripts allows executable links through namespace and control-character bypassesGHSA-w27v-7q3p-w38r · 8 Sep 2026Fixed in 3.3.5
- HighSVGO removeScripts plugin leaves some executable scripts intactGHSA-2p49-hgcm-8545 · 21 Jul 2026Fixed in 3.3.4
- HighSVGO DoS through entity expansion in DOCTYPE (Billion Laughs)GHSA-xpqw-6gx7-v673 · 4 Mar 2026Fixed in 3.3.3
- ModerateSVGO: removeScripts incompletely sanitizes executable HTML in SVG foreignObject elementsGHSA-4vpr-x523-8j87 · 8 Sep 2026Fixed in 3.3.5
Release note
What's Changed
Bug Fixes
prefixIds, correctly prefix IDs when
<style>tag contains XML comments.removeHiddenElems, improve handling of definitions (
<defs>), namely when<defs>are defined at the end of the document.cleanupEnableBackground, clean up inline-styles too.
cleanupIds, handle URI encoded references properly.
inlineStyles, no longer crashes on non-inlined selectors with a pseudo-class.
Improve handling of URL references in reference attributes (
url('#a')) across various plugins.
SVG Optimization
removeUnknownsAndDefaults, now removes defaults in XML declarations too, enabled by default and can be toggled with
defaultMarkupDeclarations.
Metrics
Before and after using vectors from various sources, with the default preset of each respective version:
| SVG | Original | v3.0.5 | v3.1.0 | Delta |
|---|---|---|---|---|
| Arch Linux Logo | 9.529 KiB | 4.608 KiB | 4.162 KiB | ⬇️ 0.446 KiB |
| Blobs | 50.45 KiB | 42.949 KiB | 42.949 KiB | |
| Isometric Madness | 869.034 KiB | 550.153 KiB | 550.153 KiB | |
| tldr-pages Banner | 2.071 KiB | 1.07 KiB | 1.07 KiB | |
| Wikipedia Logo | 161.551 KiB | 117.146 KiB | 116 KiB | ⬇️ 1.146 KiB |
Before and after of the browser bundle of each respective version:
| v3.0.5 | v3.1.0 | Delta | |
|---|---|---|---|
| svgo.browser.js | 657.5 kB | 660.9 kB | ⬆️ 3.4 kB |
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.