svglib maintainers patch nested SVG resource-consumption vulnerability

  • svglib
  • svg2rlg
  • SVG resource consumption

The flaw affected the svg2rlg function

An SVG of about 1.4 KB could generate over 100,000 nodes

Affected applications include xhtml2pdf

svglib maintainers patched an exponential resource-consumption vulnerability in the svg2rlg function, according to a GitHub advisory published on November 20, 2026. The flaw could cause excessive resource use when the function rendered SVG files containing nested <use> references.

The function expanded <use> references without limiting the total number of expansions. Although it rejected direct cycles, nested groups could multiply the rendering work at each level. An SVG document of about 1.4 KB could lead svglib to create and render more than 100,000 nodes, using tens of seconds of CPU time and hundreds of MiB of memory. Each additional nesting level increased processing time by about 10 times.

The vulnerability affects applications that use svglib to render SVG files, including xhtml2pdf. The advisory reports that the maintainers patched the flaw; the supplied information does not specify affected versions.