🚨 [security] Update svgo 3.0.0 → 4.1.0 (major) - #261

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0
Open

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major)#261
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0

Conversation

@depfu

@depfudepfuBot commented Aug 31, 2026

Copy link
Copy Markdown

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ svgo (3.0.0 → 4.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ css-select (indirect, 5.1.0 → 6.0.0) · Repo

Release Notes

6.0.0

  • Re-release of 5.2.0
  • Switch to tshy, vitest & Biome (#1596) f7fd5fc

v5.2.1...v6.0.0

5.2.1

The previous release was missing the dist directory.

Release 5.2.0 and 5.2.1 included breaking changes; 5.2.2 is a re-publish of 5.1.0


v5.2.0...v5.2.1

5.2.0

New Features

  • Cache results for subtrees; vastly speeds up :contains and :has#1025 – by @fb55
  • Add support for :read-only and :read-write pseudos #1497 – by @jed
  • Improved support for large documents #1132 – by @fb55

Fixes

  • Allow whitespace in :empty#795 – by @fb55
  • Filter queried elements inside template element #981 – by @andolf
  • Handle template tags in selectOne#1001 – by @fb55

New Contributors

Full Changelog: v5.1.0...v5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ nth-check (indirect, 2.0.1 → 2.1.1) · Repo

Release Notes

2.1.1

  • The ESM code had some issues that are now fixed aeeb067

v2.1.0...v2.1.1

2.1.0

What's Changed

  • nth-check is now a dual CommonJS and ESM module #206
  • With the new sequence and generate methods, it is now possible to generate a sequence of indices for a given formula #207

Full Changelog: v2.0.1...v2.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ picocolors (indirect, 1.0.0 → 1.1.1) · Repo · Changelog

Release Notes

1.1.1

What's new?

  • Moved TypeScript declarations to a d.ts file #82
  • Reworked color detection algorithm to properly work with empty strings in NO_COLOR and FORCE_COLOR env variables #87
  • Eliminated require() call to make the package compatible with some tools #87

1.1.0

What's new?

  • Added bright color variants #55

1.0.1

What's new?

  • Updated color detection mechanism to work properly on Vercel Edge Runtime #64
  • Remove use of recursion to avoid possible stack overflow for very long inputs #56

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

↗️ source-map-js (indirect, 1.0.2 → 1.2.1) · Repo · Changelog

Release Notes

1.2.1

1.2.0

Allow to pass options to SourceMapGenerator using SourceMapGenerator.fromSourceMap as second argument

vargenerator=sourceMap.SourceMapGenerator.fromSourceMap(newSourceMapConsumer(),{ignoreInvalidMapping: true,});
  • Add generator options to fromSourceMap (#22) @ai

1.1.0

Add ignoreInvalidMapping option to SourceMapGenerator. If enabled, source-map-js will not throw an error on the incorrect previous source map. Instead, it will print warnings and ignore broken mappings.

vargenerator=newsourceMap.SourceMapGenerator({file: "my-generated-javascript-file.js",sourceRoot: "http://example.com/app/js/",ignoreInvalidMapping: true,});
  • Do not throw an error since broken prev map is popular issue #20 (#20) @ai
  • Add ignoreInvalidMapping option (#21) @7rulnik

1.0.3

  • Use sourceContents when non-null, even if it's an empty string (#17) @bshepherdson

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

🆕 sax (added, 1.6.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfudepfuBot added the depfu label Aug 31, 2026
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz CodeflowRun & review this pull request in StackBlitz Codeflow.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29fcd52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​svgo@​3.0.0 ⏵ 4.1.0100+1100+2210096+10100

View full report

@mergify

mergifyBot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major) - #261

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0
Open

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major)#261
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0

Conversation

@depfu

@depfudepfuBot commented Aug 31, 2026

Copy link
Copy Markdown

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ svgo (3.0.0 → 4.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ css-select (indirect, 5.1.0 → 6.0.0) · Repo

Release Notes

6.0.0

  • Re-release of 5.2.0
  • Switch to tshy, vitest & Biome (#1596) f7fd5fc

v5.2.1...v6.0.0

5.2.1

The previous release was missing the dist directory.

Release 5.2.0 and 5.2.1 included breaking changes; 5.2.2 is a re-publish of 5.1.0


v5.2.0...v5.2.1

5.2.0

New Features

  • Cache results for subtrees; vastly speeds up :contains and :has#1025 – by @fb55
  • Add support for :read-only and :read-write pseudos #1497 – by @jed
  • Improved support for large documents #1132 – by @fb55

Fixes

  • Allow whitespace in :empty#795 – by @fb55
  • Filter queried elements inside template element #981 – by @andolf
  • Handle template tags in selectOne#1001 – by @fb55

New Contributors

Full Changelog: v5.1.0...v5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ nth-check (indirect, 2.0.1 → 2.1.1) · Repo

Release Notes

2.1.1

  • The ESM code had some issues that are now fixed aeeb067

v2.1.0...v2.1.1

2.1.0

What's Changed

  • nth-check is now a dual CommonJS and ESM module #206
  • With the new sequence and generate methods, it is now possible to generate a sequence of indices for a given formula #207

Full Changelog: v2.0.1...v2.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ picocolors (indirect, 1.0.0 → 1.1.1) · Repo · Changelog

Release Notes

1.1.1

What's new?

  • Moved TypeScript declarations to a d.ts file #82
  • Reworked color detection algorithm to properly work with empty strings in NO_COLOR and FORCE_COLOR env variables #87
  • Eliminated require() call to make the package compatible with some tools #87

1.1.0

What's new?

  • Added bright color variants #55

1.0.1

What's new?

  • Updated color detection mechanism to work properly on Vercel Edge Runtime #64
  • Remove use of recursion to avoid possible stack overflow for very long inputs #56

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

↗️ source-map-js (indirect, 1.0.2 → 1.2.1) · Repo · Changelog

Release Notes

1.2.1

1.2.0

Allow to pass options to SourceMapGenerator using SourceMapGenerator.fromSourceMap as second argument

vargenerator=sourceMap.SourceMapGenerator.fromSourceMap(newSourceMapConsumer(),{ignoreInvalidMapping: true,});
  • Add generator options to fromSourceMap (#22) @ai

1.1.0

Add ignoreInvalidMapping option to SourceMapGenerator. If enabled, source-map-js will not throw an error on the incorrect previous source map. Instead, it will print warnings and ignore broken mappings.

vargenerator=newsourceMap.SourceMapGenerator({file: "my-generated-javascript-file.js",sourceRoot: "http://example.com/app/js/",ignoreInvalidMapping: true,});
  • Do not throw an error since broken prev map is popular issue #20 (#20) @ai
  • Add ignoreInvalidMapping option (#21) @7rulnik

1.0.3

  • Use sourceContents when non-null, even if it's an empty string (#17) @bshepherdson

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

🆕 sax (added, 1.6.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfudepfuBot added the depfu label Aug 31, 2026
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz CodeflowRun & review this pull request in StackBlitz Codeflow.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29fcd52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​svgo@​3.0.0 ⏵ 4.1.0100+1100+2210096+10100

View full report

@mergify

mergifyBot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major) - #261

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0
Open

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major)#261
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0

Conversation

@depfu

@depfudepfuBot commented Aug 31, 2026

Copy link
Copy Markdown

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ svgo (3.0.0 → 4.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ css-select (indirect, 5.1.0 → 6.0.0) · Repo

Release Notes

6.0.0

  • Re-release of 5.2.0
  • Switch to tshy, vitest & Biome (#1596) f7fd5fc

v5.2.1...v6.0.0

5.2.1

The previous release was missing the dist directory.

Release 5.2.0 and 5.2.1 included breaking changes; 5.2.2 is a re-publish of 5.1.0


v5.2.0...v5.2.1

5.2.0

New Features

  • Cache results for subtrees; vastly speeds up :contains and :has#1025 – by @fb55
  • Add support for :read-only and :read-write pseudos #1497 – by @jed
  • Improved support for large documents #1132 – by @fb55

Fixes

  • Allow whitespace in :empty#795 – by @fb55
  • Filter queried elements inside template element #981 – by @andolf
  • Handle template tags in selectOne#1001 – by @fb55

New Contributors

Full Changelog: v5.1.0...v5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ nth-check (indirect, 2.0.1 → 2.1.1) · Repo

Release Notes

2.1.1

  • The ESM code had some issues that are now fixed aeeb067

v2.1.0...v2.1.1

2.1.0

What's Changed

  • nth-check is now a dual CommonJS and ESM module #206
  • With the new sequence and generate methods, it is now possible to generate a sequence of indices for a given formula #207

Full Changelog: v2.0.1...v2.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ picocolors (indirect, 1.0.0 → 1.1.1) · Repo · Changelog

Release Notes

1.1.1

What's new?

  • Moved TypeScript declarations to a d.ts file #82
  • Reworked color detection algorithm to properly work with empty strings in NO_COLOR and FORCE_COLOR env variables #87
  • Eliminated require() call to make the package compatible with some tools #87

1.1.0

What's new?

  • Added bright color variants #55

1.0.1

What's new?

  • Updated color detection mechanism to work properly on Vercel Edge Runtime #64
  • Remove use of recursion to avoid possible stack overflow for very long inputs #56

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

↗️ source-map-js (indirect, 1.0.2 → 1.2.1) · Repo · Changelog

Release Notes

1.2.1

1.2.0

Allow to pass options to SourceMapGenerator using SourceMapGenerator.fromSourceMap as second argument

vargenerator=sourceMap.SourceMapGenerator.fromSourceMap(newSourceMapConsumer(),{ignoreInvalidMapping: true,});
  • Add generator options to fromSourceMap (#22) @ai

1.1.0

Add ignoreInvalidMapping option to SourceMapGenerator. If enabled, source-map-js will not throw an error on the incorrect previous source map. Instead, it will print warnings and ignore broken mappings.

vargenerator=newsourceMap.SourceMapGenerator({file: "my-generated-javascript-file.js",sourceRoot: "http://example.com/app/js/",ignoreInvalidMapping: true,});
  • Do not throw an error since broken prev map is popular issue #20 (#20) @ai
  • Add ignoreInvalidMapping option (#21) @7rulnik

1.0.3

  • Use sourceContents when non-null, even if it's an empty string (#17) @bshepherdson

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

🆕 sax (added, 1.6.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfudepfuBot added the depfu label Aug 31, 2026
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz CodeflowRun & review this pull request in StackBlitz Codeflow.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29fcd52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​svgo@​3.0.0 ⏵ 4.1.0100+1100+2210096+10100

View full report

@mergify

mergifyBot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major) - #261

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0
Open

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major)#261
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0

Conversation

@depfu

@depfudepfuBot commented Aug 31, 2026

Copy link
Copy Markdown

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ svgo (3.0.0 → 4.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ css-select (indirect, 5.1.0 → 6.0.0) · Repo

Release Notes

6.0.0

  • Re-release of 5.2.0
  • Switch to tshy, vitest & Biome (#1596) f7fd5fc

v5.2.1...v6.0.0

5.2.1

The previous release was missing the dist directory.

Release 5.2.0 and 5.2.1 included breaking changes; 5.2.2 is a re-publish of 5.1.0


v5.2.0...v5.2.1

5.2.0

New Features

  • Cache results for subtrees; vastly speeds up :contains and :has#1025 – by @fb55
  • Add support for :read-only and :read-write pseudos #1497 – by @jed
  • Improved support for large documents #1132 – by @fb55

Fixes

  • Allow whitespace in :empty#795 – by @fb55
  • Filter queried elements inside template element #981 – by @andolf
  • Handle template tags in selectOne#1001 – by @fb55

New Contributors

Full Changelog: v5.1.0...v5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ nth-check (indirect, 2.0.1 → 2.1.1) · Repo

Release Notes

2.1.1

  • The ESM code had some issues that are now fixed aeeb067

v2.1.0...v2.1.1

2.1.0

What's Changed

  • nth-check is now a dual CommonJS and ESM module #206
  • With the new sequence and generate methods, it is now possible to generate a sequence of indices for a given formula #207

Full Changelog: v2.0.1...v2.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ picocolors (indirect, 1.0.0 → 1.1.1) · Repo · Changelog

Release Notes

1.1.1

What's new?

  • Moved TypeScript declarations to a d.ts file #82
  • Reworked color detection algorithm to properly work with empty strings in NO_COLOR and FORCE_COLOR env variables #87
  • Eliminated require() call to make the package compatible with some tools #87

1.1.0

What's new?

  • Added bright color variants #55

1.0.1

What's new?

  • Updated color detection mechanism to work properly on Vercel Edge Runtime #64
  • Remove use of recursion to avoid possible stack overflow for very long inputs #56

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

↗️ source-map-js (indirect, 1.0.2 → 1.2.1) · Repo · Changelog

Release Notes

1.2.1

1.2.0

Allow to pass options to SourceMapGenerator using SourceMapGenerator.fromSourceMap as second argument

vargenerator=sourceMap.SourceMapGenerator.fromSourceMap(newSourceMapConsumer(),{ignoreInvalidMapping: true,});
  • Add generator options to fromSourceMap (#22) @ai

1.1.0

Add ignoreInvalidMapping option to SourceMapGenerator. If enabled, source-map-js will not throw an error on the incorrect previous source map. Instead, it will print warnings and ignore broken mappings.

vargenerator=newsourceMap.SourceMapGenerator({file: "my-generated-javascript-file.js",sourceRoot: "http://example.com/app/js/",ignoreInvalidMapping: true,});
  • Do not throw an error since broken prev map is popular issue #20 (#20) @ai
  • Add ignoreInvalidMapping option (#21) @7rulnik

1.0.3

  • Use sourceContents when non-null, even if it's an empty string (#17) @bshepherdson

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

🆕 sax (added, 1.6.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfudepfuBot added the depfu label Aug 31, 2026
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz CodeflowRun & review this pull request in StackBlitz Codeflow.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29fcd52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​svgo@​3.0.0 ⏵ 4.1.0100+1100+2210096+10100

View full report

@mergify

mergifyBot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major) - #261

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0
Open

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major)#261
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0

Conversation

@depfu

@depfudepfuBot commented Aug 31, 2026

Copy link
Copy Markdown

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ svgo (3.0.0 → 4.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ css-select (indirect, 5.1.0 → 6.0.0) · Repo

Release Notes

6.0.0

  • Re-release of 5.2.0
  • Switch to tshy, vitest & Biome (#1596) f7fd5fc

v5.2.1...v6.0.0

5.2.1

The previous release was missing the dist directory.

Release 5.2.0 and 5.2.1 included breaking changes; 5.2.2 is a re-publish of 5.1.0


v5.2.0...v5.2.1

5.2.0

New Features

  • Cache results for subtrees; vastly speeds up :contains and :has#1025 – by @fb55
  • Add support for :read-only and :read-write pseudos #1497 – by @jed
  • Improved support for large documents #1132 – by @fb55

Fixes

  • Allow whitespace in :empty#795 – by @fb55
  • Filter queried elements inside template element #981 – by @andolf
  • Handle template tags in selectOne#1001 – by @fb55

New Contributors

Full Changelog: v5.1.0...v5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ nth-check (indirect, 2.0.1 → 2.1.1) · Repo

Release Notes

2.1.1

  • The ESM code had some issues that are now fixed aeeb067

v2.1.0...v2.1.1

2.1.0

What's Changed

  • nth-check is now a dual CommonJS and ESM module #206
  • With the new sequence and generate methods, it is now possible to generate a sequence of indices for a given formula #207

Full Changelog: v2.0.1...v2.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ picocolors (indirect, 1.0.0 → 1.1.1) · Repo · Changelog

Release Notes

1.1.1

What's new?

  • Moved TypeScript declarations to a d.ts file #82
  • Reworked color detection algorithm to properly work with empty strings in NO_COLOR and FORCE_COLOR env variables #87
  • Eliminated require() call to make the package compatible with some tools #87

1.1.0

What's new?

  • Added bright color variants #55

1.0.1

What's new?

  • Updated color detection mechanism to work properly on Vercel Edge Runtime #64
  • Remove use of recursion to avoid possible stack overflow for very long inputs #56

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

↗️ source-map-js (indirect, 1.0.2 → 1.2.1) · Repo · Changelog

Release Notes

1.2.1

1.2.0

Allow to pass options to SourceMapGenerator using SourceMapGenerator.fromSourceMap as second argument

vargenerator=sourceMap.SourceMapGenerator.fromSourceMap(newSourceMapConsumer(),{ignoreInvalidMapping: true,});
  • Add generator options to fromSourceMap (#22) @ai

1.1.0

Add ignoreInvalidMapping option to SourceMapGenerator. If enabled, source-map-js will not throw an error on the incorrect previous source map. Instead, it will print warnings and ignore broken mappings.

vargenerator=newsourceMap.SourceMapGenerator({file: "my-generated-javascript-file.js",sourceRoot: "http://example.com/app/js/",ignoreInvalidMapping: true,});
  • Do not throw an error since broken prev map is popular issue #20 (#20) @ai
  • Add ignoreInvalidMapping option (#21) @7rulnik

1.0.3

  • Use sourceContents when non-null, even if it's an empty string (#17) @bshepherdson

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

🆕 sax (added, 1.6.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfudepfuBot added the depfu label Aug 31, 2026
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz CodeflowRun & review this pull request in StackBlitz Codeflow.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29fcd52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​svgo@​3.0.0 ⏵ 4.1.0100+1100+2210096+10100

View full report

@mergify

mergifyBot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major) - #261

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0
Open

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major)#261
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0

Conversation

@depfu

@depfudepfuBot commented Aug 31, 2026

Copy link
Copy Markdown

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ svgo (3.0.0 → 4.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ css-select (indirect, 5.1.0 → 6.0.0) · Repo

Release Notes

6.0.0

  • Re-release of 5.2.0
  • Switch to tshy, vitest & Biome (#1596) f7fd5fc

v5.2.1...v6.0.0

5.2.1

The previous release was missing the dist directory.

Release 5.2.0 and 5.2.1 included breaking changes; 5.2.2 is a re-publish of 5.1.0


v5.2.0...v5.2.1

5.2.0

New Features

  • Cache results for subtrees; vastly speeds up :contains and :has#1025 – by @fb55
  • Add support for :read-only and :read-write pseudos #1497 – by @jed
  • Improved support for large documents #1132 – by @fb55

Fixes

  • Allow whitespace in :empty#795 – by @fb55
  • Filter queried elements inside template element #981 – by @andolf
  • Handle template tags in selectOne#1001 – by @fb55

New Contributors

Full Changelog: v5.1.0...v5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ nth-check (indirect, 2.0.1 → 2.1.1) · Repo

Release Notes

2.1.1

  • The ESM code had some issues that are now fixed aeeb067

v2.1.0...v2.1.1

2.1.0

What's Changed

  • nth-check is now a dual CommonJS and ESM module #206
  • With the new sequence and generate methods, it is now possible to generate a sequence of indices for a given formula #207

Full Changelog: v2.0.1...v2.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ picocolors (indirect, 1.0.0 → 1.1.1) · Repo · Changelog

Release Notes

1.1.1

What's new?

  • Moved TypeScript declarations to a d.ts file #82
  • Reworked color detection algorithm to properly work with empty strings in NO_COLOR and FORCE_COLOR env variables #87
  • Eliminated require() call to make the package compatible with some tools #87

1.1.0

What's new?

  • Added bright color variants #55

1.0.1

What's new?

  • Updated color detection mechanism to work properly on Vercel Edge Runtime #64
  • Remove use of recursion to avoid possible stack overflow for very long inputs #56

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

↗️ source-map-js (indirect, 1.0.2 → 1.2.1) · Repo · Changelog

Release Notes

1.2.1

1.2.0

Allow to pass options to SourceMapGenerator using SourceMapGenerator.fromSourceMap as second argument

vargenerator=sourceMap.SourceMapGenerator.fromSourceMap(newSourceMapConsumer(),{ignoreInvalidMapping: true,});
  • Add generator options to fromSourceMap (#22) @ai

1.1.0

Add ignoreInvalidMapping option to SourceMapGenerator. If enabled, source-map-js will not throw an error on the incorrect previous source map. Instead, it will print warnings and ignore broken mappings.

vargenerator=newsourceMap.SourceMapGenerator({file: "my-generated-javascript-file.js",sourceRoot: "http://example.com/app/js/",ignoreInvalidMapping: true,});
  • Do not throw an error since broken prev map is popular issue #20 (#20) @ai
  • Add ignoreInvalidMapping option (#21) @7rulnik

1.0.3

  • Use sourceContents when non-null, even if it's an empty string (#17) @bshepherdson

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

🆕 sax (added, 1.6.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfudepfuBot added the depfu label Aug 31, 2026
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz CodeflowRun & review this pull request in StackBlitz Codeflow.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29fcd52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​svgo@​3.0.0 ⏵ 4.1.0100+1100+2210096+10100

View full report

@mergify

mergifyBot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major) - #261

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0
Open

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major)#261
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0

Conversation

@depfu

@depfudepfuBot commented Aug 31, 2026

Copy link
Copy Markdown

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ svgo (3.0.0 → 4.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ css-select (indirect, 5.1.0 → 6.0.0) · Repo

Release Notes

6.0.0

  • Re-release of 5.2.0
  • Switch to tshy, vitest & Biome (#1596) f7fd5fc

v5.2.1...v6.0.0

5.2.1

The previous release was missing the dist directory.

Release 5.2.0 and 5.2.1 included breaking changes; 5.2.2 is a re-publish of 5.1.0


v5.2.0...v5.2.1

5.2.0

New Features

  • Cache results for subtrees; vastly speeds up :contains and :has#1025 – by @fb55
  • Add support for :read-only and :read-write pseudos #1497 – by @jed
  • Improved support for large documents #1132 – by @fb55

Fixes

  • Allow whitespace in :empty#795 – by @fb55
  • Filter queried elements inside template element #981 – by @andolf
  • Handle template tags in selectOne#1001 – by @fb55

New Contributors

Full Changelog: v5.1.0...v5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ nth-check (indirect, 2.0.1 → 2.1.1) · Repo

Release Notes

2.1.1

  • The ESM code had some issues that are now fixed aeeb067

v2.1.0...v2.1.1

2.1.0

What's Changed

  • nth-check is now a dual CommonJS and ESM module #206
  • With the new sequence and generate methods, it is now possible to generate a sequence of indices for a given formula #207

Full Changelog: v2.0.1...v2.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ picocolors (indirect, 1.0.0 → 1.1.1) · Repo · Changelog

Release Notes

1.1.1

What's new?

  • Moved TypeScript declarations to a d.ts file #82
  • Reworked color detection algorithm to properly work with empty strings in NO_COLOR and FORCE_COLOR env variables #87
  • Eliminated require() call to make the package compatible with some tools #87

1.1.0

What's new?

  • Added bright color variants #55

1.0.1

What's new?

  • Updated color detection mechanism to work properly on Vercel Edge Runtime #64
  • Remove use of recursion to avoid possible stack overflow for very long inputs #56

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

↗️ source-map-js (indirect, 1.0.2 → 1.2.1) · Repo · Changelog

Release Notes

1.2.1

1.2.0

Allow to pass options to SourceMapGenerator using SourceMapGenerator.fromSourceMap as second argument

vargenerator=sourceMap.SourceMapGenerator.fromSourceMap(newSourceMapConsumer(),{ignoreInvalidMapping: true,});
  • Add generator options to fromSourceMap (#22) @ai

1.1.0

Add ignoreInvalidMapping option to SourceMapGenerator. If enabled, source-map-js will not throw an error on the incorrect previous source map. Instead, it will print warnings and ignore broken mappings.

vargenerator=newsourceMap.SourceMapGenerator({file: "my-generated-javascript-file.js",sourceRoot: "http://example.com/app/js/",ignoreInvalidMapping: true,});
  • Do not throw an error since broken prev map is popular issue #20 (#20) @ai
  • Add ignoreInvalidMapping option (#21) @7rulnik

1.0.3

  • Use sourceContents when non-null, even if it's an empty string (#17) @bshepherdson

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

🆕 sax (added, 1.6.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfudepfuBot added the depfu label Aug 31, 2026
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz CodeflowRun & review this pull request in StackBlitz Codeflow.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29fcd52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​svgo@​3.0.0 ⏵ 4.1.0100+1100+2210096+10100

View full report

@mergify

mergifyBot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major) - #261

Open
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0
Open

🚨 [security] Update svgo 3.0.0 → 4.1.0 (major)#261
depfu[bot] wants to merge 1 commit into
masterfrom
depfu/update/npm/svgo-4.1.0

Conversation

@depfu

@depfudepfuBot commented Aug 31, 2026

Copy link
Copy Markdown

Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ svgo (3.0.0 → 4.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO removeScripts plugin leaves some executable scripts intact

Summary

SVGO's removeScripts plugin (disabled by default) removes scripts from the SVG, however executable scripts were left intact in some cases. If a consumer relied on this plugin for sanitization and served them to users, these SVGs could open up doors to XSS.

Details

SVGO has a plugin for removing scripts from an SVG, which removes:

  • <script> elements
  • JavaScript URIs (v4 and v3 only)
  • on… event handlers (v4 and v3 only)

While SVGO is not a sanitization library, SVGO continues to maintain the plugin for those already using it for this purpose.

However, there were two problems:

  • SVGO did not check namespaced/prefixed script elements, for example if one declared an explicit prefix for the SVG namespace ( <svg:script>) instead of using the default namespace ( <script>), the <svg:script> tag would be left intact.
  • SVGO case sensitively matched JavaScript URIs, but it should've been case-insensitive.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:uwu="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" version="1.1"&gt;</span> <span class="pl-s"> &lt;a uwu:href="JavaScript:(() =&amp;gt; { alert(document.cookie) })();"&gt;&lt;text y="30"&gt;uwu&lt;/text&gt;&lt;/a&gt;</span> <span class="pl-s"> &lt;svg:script&gt;</span> <span class="pl-s"> alert(document.cookie);</span> <span class="pl-s"> &lt;/svg:script&gt;</span> <span class="pl-s"> &lt;/svg&gt;</span> <span class="pl-s">;

optimize(original,{
plugins: ['removeScripts']
});
// Did not remove <svg:script> or uwu:href="JavaScript:…—still executed by browsers.

Impact

If you run SVGO on untrusted input (e.g., user uploads to a web application) and you depended on removeScripts, then some scripts may still be present. If that SVG was then opened directly by another user on the same domain, it could invoke scripts that could read local storage or cookies.

This may affect you if you have enabled one of the following:

SVGO VersionPlugin Name
v4removeScripts
v3removeScriptElement
v2removeScriptElement
v1removeScriptElement

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

>= 3.0.0, <= 4.0.1

SVGO patched v4.0.2 and v3.3.4. Just upgrade the dependency using your preferred package manager! For example:

yarn up svgo

# or if SVGO is a nested dependency
yarn up -R svgo

The proposed fix is to improve our namespace-aware handling to explicitly act on the default namespace, SVG namespace, and XHTML namespace only. This handles all scripts that are executed by browsers, but will leave intact custom prefixes that happen to have an element called <*:script> which clients shouldn't treat as executable.

>= 2.0.0, <= 2.8.2

SVGO patched v2.8.3, however SVGO v2 explicitly only implements and documents that it will remove <script> elements and nothing more. It has the namespace aware handling for tags like <svg:script> or <xhtml:script>, but has not been updated to remove JavaScript URIs or event handlers like >= v3. If this is something you need, please upgrade to v4 or v3, or reach for one of the documented workarounds at the end.

>= 1.0.0, <= 1.3.2

SVGO v1 has been deprecated for a while now and won't be patched. Please upgrade to a more recent version! If something is preventing you from doing so, please reach out! We're happy to expand our migration guides or support you if you're having trouble.

Workarounds

If your motivation for enabling the plugin is SVG sanitization, consider reaching for a dedicated SVG sanitization tool and invoke it before passing the SVG to SVGO.

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

🚨 SVGO DoS through entity expansion in DOCTYPE (Billion Laughs)

Summary

SVGO accepts XML with custom entities, without guards against entity expansion or recursion. This can result in a small XML file (811 bytes) stalling the application and even crashing the Node.js process with JavaScript heap out of memory.

Details

The upstream XML parser (sax) doesn't interpret custom XML entities by default. We pattern matched custom XML entities from the DOCTYPE, inserting them into parser.ENTITIES, and enabled unparsedEntities. This gives us the desired behavior of supporting SVGs with entities declared in the DOCTYPE.

However, entities can reference other entities, which can enable small SVGs to explode exponentially when we try to parse them.

Proof of Concept

import{optimize}from'svgo';

/** Presume that this string was obtained in some other way, such as network. */
constoriginal=</span> <span class="pl-s"> &lt;?xml version="1.0"?&gt;</span> <span class="pl-s"> &lt;!DOCTYPE lolz [</span> <span class="pl-s"> &lt;!ENTITY lol "lol"&gt;</span> <span class="pl-s"> &lt;!ELEMENT lolz (#PCDATA)&gt;</span> <span class="pl-s"> &lt;!ENTITY lol1 "&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;&amp;lol;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol2 "&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;&amp;lol1;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol3 "&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;&amp;lol2;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol4 "&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;&amp;lol3;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol5 "&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;&amp;lol4;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol6 "&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;&amp;lol5;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol7 "&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;&amp;lol6;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol8 "&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;&amp;lol7;"&gt;</span> <span class="pl-s"> &lt;!ENTITY lol9 "&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;&amp;lol8;"&gt;</span> <span class="pl-s"> ]&gt;</span> <span class="pl-s"> &lt;lolz&gt;&amp;lol9;&lt;/lolz&gt;</span> <span class="pl-s">;

optimize(original);

Impact

If SVGO is run on untrusted input (i.e., user uploaded to server-side application), then the untrusted SVG can effectively stall or crash the application with an SVG < 1 KB in size.

It's unlikely to impact users who just use SVGO locally on their own SVGs or in build pipelines.

Patches

SVGO has patched v4.0.1, v3.3.3, and v2.8.1! However, it's strongly recommended to upgrade to v4 regardless, as previous versions are not officially supported anymore.

Workarounds

== 4.0.0

For v4, users do not specifically have to upgrade SVGO, though it is recommended to do so. A package manager can be used to upgrade sax recursively:

For example:

yarn up -R sax

New options were introduced upstream which makes the way SVGO parses SVGs safe by default.

>= 2.1.0, <= 3.3.2

Users of v3 and v2 will have to take manual action. If users can't upgrade, they may be able to work around this as long as the project doesn't require support for custom XML entities, though it's not a simple flag.

Parse the DOCTYPE directly and check for the presence of custom entities. If entities are present, throw/escape before passing them to SVGO.

+ import SAX from 'sax';
import { optimize } from 'svgo';

- const original =</span> <span class="pl-mi1"><span class="pl-mi1">+</span> let original =
<?xml version="1.0"?>
<!DOCTYPE lolz [
<!ENTITY lol "lol">
<!ELEMENT lolz (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
]>
<lolz>&lol9;</lolz>
`;

+ const parser = SAX.parser();
+ /** @param {string} doctype */
+ parser.ondoctype = (doctype) => {
+ original = original.replace(doctype, '');
+ }
+ parser.write(original);

optimize(original);

Resources

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ css-select (indirect, 5.1.0 → 6.0.0) · Repo

Release Notes

6.0.0

  • Re-release of 5.2.0
  • Switch to tshy, vitest & Biome (#1596) f7fd5fc

v5.2.1...v6.0.0

5.2.1

The previous release was missing the dist directory.

Release 5.2.0 and 5.2.1 included breaking changes; 5.2.2 is a re-publish of 5.1.0


v5.2.0...v5.2.1

5.2.0

New Features

  • Cache results for subtrees; vastly speeds up :contains and :has#1025 – by @fb55
  • Add support for :read-only and :read-write pseudos #1497 – by @jed
  • Improved support for large documents #1132 – by @fb55

Fixes

  • Allow whitespace in :empty#795 – by @fb55
  • Filter queried elements inside template element #981 – by @andolf
  • Handle template tags in selectOne#1001 – by @fb55

New Contributors

Full Changelog: v5.1.0...v5.2.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ nth-check (indirect, 2.0.1 → 2.1.1) · Repo

Release Notes

2.1.1

  • The ESM code had some issues that are now fixed aeeb067

v2.1.0...v2.1.1

2.1.0

What's Changed

  • nth-check is now a dual CommonJS and ESM module #206
  • With the new sequence and generate methods, it is now possible to generate a sequence of indices for a given formula #207

Full Changelog: v2.0.1...v2.1.0

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ picocolors (indirect, 1.0.0 → 1.1.1) · Repo · Changelog

Release Notes

1.1.1

What's new?

  • Moved TypeScript declarations to a d.ts file #82
  • Reworked color detection algorithm to properly work with empty strings in NO_COLOR and FORCE_COLOR env variables #87
  • Eliminated require() call to make the package compatible with some tools #87

1.1.0

What's new?

  • Added bright color variants #55

1.0.1

What's new?

  • Updated color detection mechanism to work properly on Vercel Edge Runtime #64
  • Remove use of recursion to avoid possible stack overflow for very long inputs #56

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

↗️ source-map-js (indirect, 1.0.2 → 1.2.1) · Repo · Changelog

Release Notes

1.2.1

1.2.0

Allow to pass options to SourceMapGenerator using SourceMapGenerator.fromSourceMap as second argument

vargenerator=sourceMap.SourceMapGenerator.fromSourceMap(newSourceMapConsumer(),{ignoreInvalidMapping: true,});
  • Add generator options to fromSourceMap (#22) @ai

1.1.0

Add ignoreInvalidMapping option to SourceMapGenerator. If enabled, source-map-js will not throw an error on the incorrect previous source map. Instead, it will print warnings and ignore broken mappings.

vargenerator=newsourceMap.SourceMapGenerator({file: "my-generated-javascript-file.js",sourceRoot: "http://example.com/app/js/",ignoreInvalidMapping: true,});
  • Do not throw an error since broken prev map is popular issue #20 (#20) @ai
  • Add ignoreInvalidMapping option (#21) @7rulnik

1.0.3

  • Use sourceContents when non-null, even if it's an empty string (#17) @bshepherdson

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 16 commits:

🆕 sax (added, 1.6.1)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfudepfuBot added the depfu label Aug 31, 2026
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz CodeflowRun & review this pull request in StackBlitz Codeflow.

@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 29fcd52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Updatednpm/​svgo@​3.0.0 ⏵ 4.1.0100+1100+2210096+10100

View full report

@mergify

mergifyBot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants