Skip to main content

svglib CVE-2026-137952

| EUVDEUVD-2026-137445 HIGH
Uncontrolled Recursion (CWE-674)
2026-11-27 VulnCheck GHSA-fvj4-9rvp-wvfc
8.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted <2KB SVG to svg2rlg()
  2. Exploit
    Resolve internal <image href="#..."> fragment references
  3. Execution
    Trigger unbounded recursive renderNode() expansion
  4. Impact
    Exhaust CPU/memory or RecursionError crash

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
Exploitation Conditions

No authentication or user interaction is required (PR:N/UI:N/AC:L), and no special svglib configuration is needed - the vulnerable <image href="#..."> fragment-expansion path in SvgRenderer.renderNode() is reached by default. The one essential precondition is that the host application passes attacker-controlled SVG content to svglib's svg2rlg() (e.g. an SVG-to-PDF upload/conversion feature); versions affected are svglib up to and including 2.4.0 (fixed in 2.5.0). The practical limiting factor is therefore not authentication but exposure: only deployments that actually render untrusted SVG are exploitable, and the impact is confined to availability (process hang, memory exhaustion, or RecursionError crash) with no confidentiality or integrity effect.

Impact

The CVSS 4.0 vector (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H) describes a network-reachable, low-complexity, unauthenticated flaw with no user interaction whose entire impact is availability (VA:H); confidentiality and integrity are unaffected (VC:N/VI:N), consistent with a pure denial-of-service via uncontrolled recursion (CWE-674 in the primary record; the GHSA classifies it as CWE-400 resource exhaustion). The vuln.today decision label is 'this_week' rather than act_now/emergency, and there is no CISA KEV listing and no EPSS score in the supplied data, so there is no signal of active or widespread exploitation. However, the GHSA advisory ships two concrete, working proof-of-concept payloads (a ~1.5 KB binary-tree 'billion-laughs' amplifier and a 2-line self-referencing cycle), demonstrating that exploitation is trivial once an application feeds untrusted SVG to svg2rlg(). Net assessment: a genuine, easy-to-trigger DoS with demonstrated PoC, but bounded impact (no data compromise) and dependent on the application actually processing attacker-supplied SVG - real priority for anyone converting untrusted SVGs, not a top-tier emergency. Note the CWE assignment differs between the primary record (CWE-674) and the GHSA (CWE-400); both describe the same unbounded-expansion behavior.

Exploit ScenarioDerived

An application that converts user-supplied SVG files to PDFs/ReportLab drawings calls svglib's svg2rlg() on attacker input. The attacker uploads a sub-2 KB SVG containing nested <g> groups with <image href="#..."> fragment references (exponential amplification) or a self-/mutually-referencing <image id="a" href="#a"/> (immediate cycle), causing either exponential CPU/memory exhaustion that hangs the process or an unhandled RecursionError crash. Working proof-of-concept payloads are published in the GHSA advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.8% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 27, 2026

Uncontrolled recursion in svglib's SvgRenderer.renderNode() lets a crafted SVG crash or stall any application that converts untrusted SVG into PDF via svg2rlg(). Affected are svglib up to and including 2.4.0; the internal <image href="#..."> fragment path renders referenced groups recursively without the cycle detection and expansion budgets that renderUse() gained in 2.3.1, so a roughly 2 KB binary-tree payload amplifies exponentially (2^n) into CPU and memory exhaustion, while a two-line self- or mutually-referencing <image> raises an unhandled RecursionError. The vendor shipped svglib 2.5.0 to fix it; no confirmed active exploitation (CISA KEV) and no independently verified working exploit code is reported, though the advisory publishes detailed proof-of-concept scripts, and the flaw requires no authentication (CVSS 4.0 PR:N/UI:N), with impact limited to availability (VA:H, VC:N/VI:N).

RemediationAI

Upgrade svglib to 2.5.0 (Vendor-released patch: 2.5.0), which bounds <image> fragment expansion with the same shared budgets used by <use>, skips circular internal <image> references (logging 'Circular <image> reference detected'), and skips undefined targets; the release is at https://github.com/deeplook/svglib/releases/tag/v2.5.0 with the advisory at https://github.com/deeplook/svglib/security/advisories/GHSA-cmj4-5g24-pp37. Until the upgrade is deployed, svglib 2.3.1's existing renderUse() limits do not protect the <image> path, so the practical compensating control is to reduce exposure: do not pass attacker-controlled SVG to svg2rlg(), and instead convert untrusted input in a sandboxed or resource-capped worker (wall-clock timeout, memory rlimit, separate low-privilege process) so that a 2 KB exponential payload terminates with a failure rather than hanging the service; the trade-off is that legitimate large SVGs may be killed by the same limits, which should therefore be tuned to expected document complexity. Rejecting or pre-scanning SVG that contains <image> elements whose href resolves to an internal '#' fragment removes the trigger entirely, at the cost of breaking legitimate internal-image SVGs.

Affected VersionsENISA

svglib 0 <2.5.0

Affected Packages

euvd svglib fix: 2.5.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

svglib is a pure-Python library that parses SVG (via lxml) and emits ReportLab Drawing objects, commonly used in SVG-to-PDF pipelines. When rendering an <image> whose xlink:href or href begins with '#', SvgRenderer.renderNode() looks the fragment up in the document definitions (falling back to an XPath id search) and calls self.renderNode(target) directly on the referenced element. Because that branch predates and bypasses the guardrails introduced for <use> handling, it never consults the _use_stack cycle-detection stack nor charges the work against the MAX_USE_EXPANSIONS (1000) and MAX_USE_CLONED_ELEMENTS (10000) budgets. The result is CWE-674 (uncontrolled recursion): nested groups that each contain two <image href="#previous"> elements yield 2^n expansions from a tiny DAG (the advisory measures 131,071 renderNode() calls in 1.70s from a 1,468-byte SVG at depth 16, and multi-gigabyte memory growth at greater depth), while a self-referencing or mutually referencing <image> recurses until Python's stack limit raises RecursionError. The advisory classifies the same root cause as CWE-400 (uncontrolled resource consumption); the primary record uses CWE-674. The fix in 2.5.0 adds an allow_image() budget that is shared with <use> expansions, reuses the _use_stack via a _use_origin() key, skips circular <image> references with a logged error, and no longer throws AttributeError when an <image> points at a fragment that is not yet defined.

Know when Svglib gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Untrusted SVG reaches svg2rlg() over the network with no auth or interaction and low complexity (AV:N/AC:L/PR:N/UI:N); impact is availability-only (A:H), no confidentiality or integrity effect.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 7.5 HIGH

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Technical POC Analysis

CWE-674 (Uncontrolled Recursion) per the CVE record; the GHSA text itself maps the same mechanism to CWE-400 (Uncontrolled Resource Consumption).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A high-severity availability vulnerability in svglib versions up to 2.4.0 allows unauthenticated attackers to cause service disruptions by submitting maliciously crafted SVG files. Organizations using svglib to convert untrusted SVG content-especially in document processing or reporting pipelines-face potential operational outages that could halt critical business functions and impact customer-facing services.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.8%
Top 49% exploitable
Prevalence
Medium
popular Python SVG-to-PDF library, common in PDF-generation apps, not ubiquitous
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.8%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy