Packages

svgo

4.1.0 · 24 Aug 2026MIT52.3M / weekRepositoryHomepagenpmAtom feed

Upgrading svgo From 3.2.0 to 4.1.0

10 releases in betweenevery note read

Reading releases, release notes and advisories…

Other targets from 3.2.0Newest 3.x, Clears its 4 advisories3.3.5
  1. 3.2.0yours
  2. 3.3.0breaking
  3. 3.3.1breaking
  4. 3.3.2breaking
  5. 1 release
  6. 3.3.4security
  7. 3.3.5security
  8. 4.0.0major
  9. 1 release
  10. 4.0.2security
  11. 4.1.0target

Start here

Before you upgrade

Tick each one off as you go
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking4.0.0
  • Breaking3.3.2
  • Breaking3.3.2

Security

  • 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 legacy vbscript: URLs (#2263).

    4.1.0
  • Sanitizes content inside SVG <foreignObject> elements by removing HTML event-handler attributes, srcdoc, and executable URLs from action, data, formaction, href, and src, 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 as java&#9;script: from bypassing detection while preserving elements in unrelated custom namespaces (#2268).

    4.1.0
  • 4.1.0
  • 4.1.0
  • removeScripts, remove JavaScript URIs case-insensitively and make <script> handling namespace aware.

    4.0.2
  • This addresses GHSA-4vpr-x523-8j87 and GHSA-w27v-7q3p-w38r for the v3 release line.

    3.3.5
  • This security fix has been backported, but there is no commitment to backport more complex changes in the future.

    3.3.5
  • removeScriptElement, remove JavaScript URIs case-insensitively and make <script> handling namespace aware.

    3.3.4

Release by release

  1. 4.1.0

    Security fix24 Aug 2026
    • 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 legacy vbscript: URLs (#2263).

    • Security

      Sanitizes content inside SVG <foreignObject> elements by removing HTML event-handler attributes, srcdoc, and executable URLs from action, data, formaction, href, and src, 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 as java&#9;script: from bypassing detection while preserving elements in unrelated custom namespaces (#2268).

    • Security
    • Security
  2. 4.0.2

    Security fix11 Jul 20261 new · 5 fixes
    • 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 t commands.

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

  3. 4.0.1

    4 Mar 20262 new · 2 fixes
  4. 4.0.0

    Migration needed21 Jun 20253 new · 14 fixes
    • Breaking

      Node.js v14 is no longer supported by the Node.js team, including security support, since 30 April 2023.

    • Breaking

      removeViewBox removes the scalability of SVGs.

    • Breaking

      removeTitle reduces accessibility, which preserving accessibility is more important than optimization.

    • Breaking

      svgo — for normal usage, such as scripts or server-side applications.

  5. 3.3.5

    Security fix24 Aug 20261 fix
    • Security

      This addresses GHSA-4vpr-x523-8j87 and GHSA-w27v-7q3p-w38r for the v3 release line.

    • Security

      This security fix has been backported, but there is no commitment to backport more complex changes in the future.

    • Fixed

      Handle namespace-prefixed SVG anchors and URL schemes containing ASCII tabs or newlines

  6. 3.3.4

    Security fix11 Jul 2026
    • Security

      removeScriptElement, remove JavaScript URIs case-insensitively and make <script> handling namespace aware.

  7. 3.3.3

    4 Mar 20261 fix
    • Fixed

      No longer throws error when encountering comments in DTD.

  8. 3.3.2

    Migration needed9 May 2024
    • Breaking

      This effectively made SVGO v3 a breaking change.

    • Breaking

      We'll then proceed to work on releasing v4 which will document the breaking changes, and feature further breaking changes that were slated for v4, like disabling removeViewBox by default.

13 other lines we could not sort, mostly version bumps
  • Disallowed control characters such as &#1;, &#xB;, and &#x1F;;

    4.1.0
  • UTF-16 surrogate code points such as &#xD800;;

    4.1.0
  • Invalid XML code points such as &#xFFFF;.

    4.1.0
  • removeAttributesBySelector, log warning and noop if missing parameters.

    4.0.2
  • Plugins no longer include if they are enabled or disabled by default, as this was written inconsistently. The --show-plugins argument 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).

    4.0.1
  • convertColors, now converts all references to colors excluding references to IDs to lowercase. This can be disabled by setting convertCase to false.

    4.0.0
  • convertColors, introduce parameter to convert colors to common casing (lowercase/uppercase).

    4.0.0
  • removeEditorsNSData, include Boxy SVG namespace in the list of editor namespaces to remove.

    4.0.0
  • removeEditorsNSData, include Krita namespace in the list of editor namespaces to remove.

    4.0.0

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