CVE-2026-137952 in svglibinfo

Summary

by MITRE • 11/27/2026

svglib before 2.5.0 contains a denial of service vulnerability in SvgRenderer.renderNode() that recursively renders internal <image> href fragment references without expansion limits or cycle detection. Attackers can supply crafted SVGs to svg2rlg() with nested groups referencing each other twice or self-referencing images to cause exponential resource consumption or RecursionError crashes.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 11/27/2026

The vulnerability identified in versions of the svglib library prior to 2.5.0 represents a critical flaw within its SVG rendering engine, specifically located in the SvgRenderer.renderNode method. This function is responsible for processing and converting Scalable Vector Graphics files into renderable objects, typically using ReportLab as the backend. The core technical deficiency lies in the handling of internal hyperlinks defined by href attributes pointing to fragment identifiers within the same document. When an SVG file contains nested groups or image elements that reference each other through these fragments, the renderer attempts to resolve and recursively process these references without implementing any form of depth limiting or cycle detection mechanisms. This architectural oversight allows for unbounded recursion when specific structural patterns are present in the input data.

Attackers can exploit this flaw by crafting malicious SVG files designed to trigger infinite loops during the rendering phase. Common exploitation vectors include creating nested group structures where two distinct groups reference each other, forming a circular dependency that prevents the recursive function from ever reaching its base case. Alternatively, an attacker may create self-referencing image elements or complex chains of fragment links that force the renderer into exponential resource consumption. As the recursion depth increases without bound, the application consumes increasing amounts of stack space and CPU cycles until it inevitably crashes with a RecursionError exception or becomes unresponsive due to excessive memory usage. This behavior effectively constitutes a Denial of Service condition against any service relying on svglib for SVG processing.

From an operational perspective, this vulnerability poses significant risks to applications that accept user-uploaded SVG files or process external graphics content without rigorous sanitization. If the vulnerable library is integrated into web services, document generation pipelines, or image conversion tools, a single crafted request can disrupt service availability. The impact extends beyond simple application crashes; in environments with limited resource isolation, such as shared hosting or containerized microservices lacking strict limits, this could lead to broader system instability affecting other processes on the same host. Furthermore, if the rendering process is triggered by automated background jobs, it may cause job queue backlogs and increased latency for legitimate users.

This vulnerability aligns with CWE-674, which describes Uncontrolled Recursion in functions that do not properly limit their depth of execution. It also maps to MITRE ATT&CK technique T1496, Resource Hijacking, where an attacker uses computing resources such as CPU or memory for unintended purposes, potentially leading to denial of service. The lack of input validation regarding the structural integrity and reference cycles within SVG documents is a common pitfall in parsers that assume well-formedness without verification.

Mitigation strategies primarily involve upgrading to svglib version 2.5.0 or later, where this issue has been addressed by implementing proper cycle detection and recursion limits during the rendering process. For organizations unable to immediately upgrade, defensive coding practices should be adopted at the integration layer. This includes validating SVG inputs before passing them to the renderer, potentially using a separate library for structural validation that checks for circular references in fragment identifiers. Additionally, enforcing strict resource quotas on processes executing svglib can help contain the impact of an attack by terminating tasks that exceed predefined memory or CPU thresholds. Input sanitization should also be considered as part of a broader defense-in-depth strategy to ensure that only expected and safe SVG structures are processed by the application.

Responsible

VulnCheck

Reservation

11/27/2026

Disclosure

11/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!