All vulnerabilities

PyPI

CVE-2026-132275

svglib: Exponential resource consumption via nested <use> references in svg2rlg

Severity
High 7.5
Published
20 Nov 2026
Last changed
21 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
2.3.1
Exploit chance
1.1% in the next 30 daysHigher than 65% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)XML entity expansion (CWE-776)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-555j-qj3j-c8jv
Sources
OSV.dev and GitHub

Description

svg2rlg() expands references without any limit on the total number of expansions. Only direct cycles are rejected (CircularRefError). A group containing N elements that point to another such group multiplies the work by N per nesting level, so an SVG of about 1.4 KB makes svglib clone and render over 100,000 nodes, taking tens of seconds of CPU time and hundreds of MiB of memory. Each additional level adds about 245 bytes to the document and multiplies time by ~10.

This is the SVG variant of the XML "billion laughs" attack (the same class as librsvg CVE-2019-20446).

SvgRenderer.renderUse() in src/svglib/svglib.py:

The referenced node is deep-copied under the element and rendered. Any elements inside the copied subtree go through renderUse() again. xlink_href_target() raises CircularRefError only for a direct cycle, so a reference DAG with fan-out is expanded fully: fan ** levels renders.

Payload shape (fan = 10, levels = 5):

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
svglibPyPI · osv:PyPI:svglib
  • Every version before 2.3.1

About svglib

Weekly downloads (PyPI)
1,432,311PyPI Stats, 24 Nov 2026

This is the only vulnerability in svglib in our list.

References