In svglib / elements to resolve and recursively render arbitrary internal document fragments ( self.renderNode(target) ) without enforcing any of the resource limits ( MAX_USE_EXPANSIONS = 1000 , MAX_USE_CLONED_ELEMENTS = 10000 ) or cycle-detection ( self._use_stack ) that were added to renderUse() in 2.3.1 ( CVE-2026-132275 ).
As a result, an untrusted SVG file using internal references can trigger:
Exponential CPU/Memory Denial of Service ( 2^n Billion-Laughs amplification) using a tiny (~1.5 KB) DAG of and nodes.
Immediate RecursionError crash via a 2-line self-referencing or mutually referencing .
When CVE-2026-132275 was patched in 2.3.1 , expansion counters ( self._use_expansions , self._use_cloned_elements ) and a cycle stack ( self._use_stack ) were added exclusively inside SvgRenderer.renderUse() ( src/svglib/svglib.py:1654-1710 ).
However, just above renderUse() , SvgRenderer.renderNode() ( src/svglib/svglib.py:1636-1652 ) contains a second internal fragment expansion path for nodes whose xlink:href or href starts with # :
Because this branch calls self.renderNode(target) directly:
It never checks ref_id in self._use_stack (allowing infinite recursion on #a -> #a or #a -> #b -> #a ).
It never increments or checks self._use_expansions > MAX_USE_EXPANSIONS or self._use_cloned_elements > MAX_USE_CLONED_ELEMENTS .
PoC 1: Exponential 2^n Billion-Laughs CPU/Memory Exhaustion
On svglib 2.3.1 ( HEAD ), a 1,468-byte SVG ( depth=16 ) executes 131,071 recursive renderNode() calls in 1.70s (bypassing MAX_USE_EXPANSIONS = 1000 by over 130x ), and depth=22 (~1.9 KB SVG, 8.3 million expansions) hangs the process and exhausts gigabytes of RAM building nested ReportLab Group objects.
PoC 2: Unhandled RecursionError via Self-Reference
Any application using svglib ( svg2rlg ) to convert user-supplied SVG files into ReportLab drawings or PDFs is vulnerable to remote Denial of Service (CPU freeze, memory exhaustion, or unhandled RecursionError crash) via a fragment resolutions using self._use_stack and self._use_expansions (or a unified fragment-expansion guard between renderUse() and the name == "image" branch in renderNode() ).
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
