Skip to main content

CairoSVG CVE-2026-107378

| EUVDEUVD-2026-95135 HIGH
Inefficient Algorithmic Complexity (CWE-407)
2026-10-08 security-advisories@github.com GHSA-c3jg-qh8m-j3h2
8.7
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Submit crafted SVG to renderer
  2. Exploit
    Path with many segments parsed
  3. Execution
    Quadratic tokenizer/vertex processing
  4. Impact
    CPU exhaustion denies service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
Exploitation Conditions

Exploitation requires that the target application render attacker-controlled or untrusted SVG input through CairoSVG's svg2png, svg2pdf, or svg2ps APIs on a version prior to 2.9.1; the malicious SVG must contain a path element with a large number of segments to trigger the quadratic tokenizer and the node.vertices.pop(0) draining. No authentication, user interaction, or special configuration is needed (PR:N/UI:N), and the payload can be under one megabyte. The practical limiting factor is exposure: deployments that render only trusted, developer-authored SVGs are not meaningfully at risk, while any service accepting user-uploaded SVGs for conversion is directly exposed.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) describes a network-reachable, low-complexity, unauthenticated attack requiring no user interaction, with impact confined entirely to availability (VA:H; VC:N/VI:N) - a pure denial-of-service via algorithmic complexity (CWE-407). The base score of 8.7 is driven solely by the ease of reaching the vulnerable code (svg2png/svg2pdf/svg2ps during ordinary rendering) combined with total availability impact, not by any data compromise. No EPSS score, CISA KEV listing, SSVC decision, or public exploit was provided, so there is no evidence of active exploitation or widespread weaponization; this is a high-severity-by-ease issue rather than a confirmed in-the-wild priority. The quadratic behavior is well-documented by the vendor's own fix commits, so the defect is confirmed, but real-world risk depends heavily on whether a given deployment renders untrusted, attacker-supplied SVG input. Note one conflict: the single 'Information Disclosure' tag directly contradicts the CVSS impact metrics (VC:N/VI:N, VA:H) and the DoS description - treat the DoS/availability framing as authoritative.

Exploit ScenarioDerived

An application that uses CairoSVG to render user-supplied SVGs (e.g., a document-conversion or thumbnail service) accepts a crafted sub-megabyte SVG containing a path with a very large number of segments. When svg2png/svg2pdf/svg2ps processes it, the path tokenizer's repeated slicing/rescanning and the pop(0) draining of node.vertices trigger quadratic CPU consumption, pinning a core and denying service to legitimate requests. No public exploit code was identified, but the trivial input requirements and vendor-documented root cause make reproduction straightforward.

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

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

Alert me

AnalysisAIv1 – Oct 08, 2026

CPU exhaustion during SVG rendering in CairoSVG versions prior to 2.9.1 lets an unauthenticated remote attacker deny service to any application that converts untrusted SVG input. A path element containing a large number of segments drives quadratic (O(n²)) work in cairosvg/path.py, where the tokenizer repeatedly slices and rescans the remaining path data and draw_markers drains node.vertices with pop(0); a payload well under one megabyte is sufficient to consume substantial CPU. The svg2png, svg2pdf, and svg2ps APIs all reach the vulnerable code during ordinary rendering, and the CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N, VA:H with VC:N/VI:N) confirms this is a pure availability impact requiring no authentication or user interaction; no public exploit code has been identified at time of analysis. Risk is therefore concentrated in services that render user-supplied SVGs, while deployments that only process trusted, developer-authored SVG files are not meaningfully exposed.

RemediationAI

Vendor-released patch: upgrade to CairoSVG 2.9.1 or later, available from the release page at https://github.com/Kozea/CairoSVG/releases/tag/2.9.1, which incorporates the tokenizer and marker-draining fixes in the linked upstream commits and is the only complete remedy. Until the upgrade can be deployed, treat every untrusted SVG as hostile input: enforce a hard size cap and a segment-count cap in your own pre-parse validation of the 'd' attribute (reject paths with abnormally many segments) - effective but bypassable if the parser is reached through other code paths; run each conversion in an isolated worker process or container with a strict CPU-time and memory timeout, then kill and discard the worker on expiry, which contains the blast radius but adds process-management overhead and still consumes a worker slot per slow request; and rate-limit or queue SVG conversion endpoints so a single abusive request cannot exhaust the render pool. For deployments that only ever render trusted, developer-authored SVGs, the practical exposure is negligible, so prioritization can be based on whether user-supplied SVG reaches the svg2png, svg2pdf, or svg2ps APIs. Consult GitHub advisory GHSA-c3jg-qh8m-j3h2 for the authoritative vendor guidance.

Affected VersionsENISA

CairoSVG < 2.9.1

Affected Packages

pypi cairosvg fix: 2.9.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

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

Technical ContextAI · show details

The root cause is CWE-407 (Inefficient Algorithmic Complexity) in CairoSVG's path parser. In cairosvg/path.py, the path() routine tokenized the SVG path 'd' attribute by repeatedly splitting the front off the remaining string and re-scanning it, so the cost of parsing grew with the square of the number of path segments. A second quadratic hot spot exists in draw_markers, which removes vertices one at a time using node.vertices.pop(0) - each pop shifts the entire remaining list, making marker drawing linear per element and quadratic overall. Both code paths are exercised by ordinary rendering, meaning any CairoSVG-based conversion pipeline (the svg2png, svg2pdf, and svg2ps entry points) triggers them without special options. The upstream fix replaces the ad-hoc string slicing with a single regular-expression pass (re.finditer over a PATH_LETTERS pattern) and stores the resulting tokens in a deque that supports O(1) popleft/appendleft, eliminating the repeated rescans. The fix landed in two commits referenced by the advisory. Note that one source tagged this record as 'Information Disclosure', which conflicts with the description and the independent assessment: the weakness is algorithmic denial of service with no confidentiality or integrity impact (VC:N/VI:N/SC:N/SI:N), so that tag should not be relied upon.

Know when the next one hits your stack

  • 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 (github) 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 rendering APIs with no auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is availability-only CPU exhaustion, so C:N/I:N/A:H.

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

Primary rating from Vendor (github).

CVSS VectorVendor: github

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

Lifecycle Timeline

2
Patch available
Oct 08, 2026 - 19:18 EUVD
CVE Published
Oct 08, 2026 - 18:17 cve.org
HIGH 8.7

DescriptionCVE.org

CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to 2.9.1, rendering an attacker-controlled SVG with a path containing many segments can cause quadratic CPU consumption in cairosvg/path.py. The path tokenizer repeatedly slices and rescans the remaining path data, while draw_markers drains node.vertices with node.vertices.pop(0), causing repeated linear-time work. The svg2png, svg2pdf, and svg2ps APIs reach these operations during ordinary rendering, allowing a sub-megabyte SVG to consume substantial CPU and deny service to a rendering application. This issue is fixed in version 2.9.1.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 594 pypi packages depend on cairosvg (406 direct, 192 indirect)

Ecosystem-wide dependent count for version 2.9.1.

Technical POC Analysis

Bug class: inefficient algorithmic complexity (CWE-407) - quadratic CPU in cairosvg/path.py.

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

CairoSVG, a library for converting SVG images, contains a high-severity CPU exhaustion vulnerability that allows unauthenticated attackers to cause denial of service by submitting crafted SVG files with numerous path segments. This affects any application or service that renders user-supplied SVG content, such as web applications, document converters, or image processing pipelines, potentially leading to service outages and degraded performance. No public exploit identified at time of analysis, but organizations with internet-facing SVG rendering should act promptly as no vendor-released patch is currently available.

Business Impact: High
Compensating Controls

Input validation to reject SVGs with excessive path segments, rate limiting, CPU quotas per conversion, WAF rules to detect malicious SVG patterns, sandboxing the rendering process with limited resources, and monitoring for CPU exhaustion.

Threat Intelligence Overview

EPSS Score
0.4%
Top 70% exploitable
Prevalence
Medium
common Python SVG-rendering library, moderate production footprint
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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.4%
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
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
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.

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