/

CVE-2026-132275

Severity:

HIGH RISK

(7.5)

SVG Expansion DoS (CWE-400) in svglib SVG Renderer

CVE-2026-132275

Received

Vulnerability type

Category:

Uncontrolled Resource Consumption

CWE:

CWE-400, CWE-776

Impact:

Denial of Service

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

svglib can consume excessive CPU and memory when rendering an SVG whose nested <use> references repeatedly fan out into larger copied subtrees. An attacker may cause a denial of service if an application renders an attacker-controlled SVG without a non-default option that prevents the expansion; some xhtml2pdf workflows can reach the same renderer through embedded SVG images.

Affected context

The issue affects svglib's SVG renderer in releases before 2.3.1 when it processes nested <use> references. Direct cycles are rejected, but acyclic graphs with repeated fan-out can still cause exponential node expansion during rendering. Applications that pass untrusted SVG files to the renderer may be exposed; HTML-to-PDF workflows using xhtml2pdf may also be affected when embedded SVG images are rendered through this path.

Exploit preconditions

  • Attack surface: An application or service that renders SVG files with svglib, directly or through a workflow such as xhtml2pdf.
  • Required access: The ability to supply or influence an SVG that the application processes; authentication requirements depend on the application.
  • Trigger point: Rendering an SVG containing nested <use> references.
  • Why exploitation is possible: Acyclic references with repeated fan-out can cause recursively copied subtrees to grow exponentially, consuming resources before rendering completes.

Why this happens

The renderer recursively resolves <use> references and deep-copies referenced subtrees. Rejecting direct cycles does not bound the size or total work of an acyclic reference graph with repeated fan-out. This is an uncontrolled resource consumption weakness (CWE-400); the recursive reference expansion is also related to CWE-776, which concerns unbounded recursive references.

Potential impact

  • Rendering may consume excessive CPU and memory.
  • A rendering task or worker may become unresponsive or terminate.
  • Applications that process attacker-supplied documents could experience degraded availability.
  • Shared rendering services may have reduced capacity for other users or workloads.

General mitigation guidance

Defensive patterns include bounding the amount of work and memory allowed during SVG processing, limiting reference depth and total expanded nodes, and rejecting documents that exceed defined complexity limits. Where SVG rendering is not essential, a secure-by-default approach is to disable it or accept only simpler, constrained image formats. Treat uploaded and embedded SVG content as untrusted, isolate rendering in a resource-limited process, and run that process with only the privileges it needs.

How teams detect issues like this

  • Use static analysis and code review to identify recursive SVG reference resolution, deep-copy operations, and rendering paths without depth, node-count, or resource limits.
  • Review upload, HTML-to-PDF, and document-conversion pipelines to identify whether untrusted SVGs can reach the renderer.
  • Apply policy checks requiring explicit limits or isolation for services that process complex user-controlled documents.
  • Monitor rendering jobs for unusual CPU or memory growth, timeouts, and repeated worker failures.
  • Automated code review tools may help flag recursive parsing and unbounded resource-consumption patterns.

Sources

SourceLink
github.comgithub.com/deeplook/svglib/commit/7380d3c3836940fd75f8e203fff80077b7d5a425
github.comgithub.com/deeplook/svglib/releases/tag/v2.3.1
github.comgithub.com/deeplook/svglib/security/advisories/GHSA-555j-qj3j-c8jv

Frequently asked

questions

It can be reachable through a remote-facing application if that application accepts attacker-controlled SVG content and renders it. The vulnerability itself is in the rendering path; exposure depends on how the application handles documents.

Not necessarily. Authentication depends on the application that accepts and processes the SVG; the key condition is that an attacker can cause a crafted document to be rendered.

Bound reference depth, expanded node counts, and rendering resources, and isolate the renderer with restricted CPU, memory, and privileges.

Treat SVG and other complex document formats as untrusted input, enforce complexity limits before and during processing, and test rendering workflows for resource exhaustion.

Find out what's already
exploitable in your codebase.