CVE-2026-114610: fpdf2: Exponential SVG '<use>' expansion causes CPU and memory exhaustion in 'FPDF.image()'
fpdf2 is a PDF creation library for Python. From 2.5.0 until 2.8.8, fpdf2's SVGObject.buildxref() passes nested SVG <use> references to GraphicsContext.additem(), whose default clone=True deep-copy behavior copies the complete referenced graphics tree during FPDF.image() processing. Repeating references at each nesting level makes the in-memory object count and processing work grow exponentially, allowing a small user-controlled SVG to consume excessive CPU and memory, raise MemoryError, fail PDF generation jobs, and reduce or exhaust worker capacity. ResourceAccessPolicy does not prevent the issue because the references are inline and require no external resource, XML entity, local file, or permissive network setting. This issue is fixed in version 2.8.8.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
fpdf2to a version that resolves this vulnerability.Fixed in 2.8.8
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using fpdf2 versions 2.5.0 through 2.8.8 that pass user-controlled SVG files to FPDF.image() are exposed. A small crafted SVG can consume CPU and memory during PDF generation and reduce or exhaust worker capacity.
What does an attacker need to exploit it?
The attacker needs the ability to supply an SVG processed by FPDF.image(). The SVG must contain nested and repeated inline <use> references; no external resources, XML entities, local files, or network access are required.
Does ResourceAccessPolicy mitigate the issue?
No. ResourceAccessPolicy does not prevent this condition because the malicious references are inline and do not rely on external resource access.
What version fixes the issue?
Upgrade fpdf2 to version 2.8.8. The issue is fixed in that version.