Description
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.
Published: 2026-10-08
Score: 8.7 High
EPSS: n/a
KEV: No
Impact: Denial of Service
Action: Apply Patch
AI Analysis

Impact

CairoSVG has a quadratic‑time denial‑of‑service flaw that triggers when parsing an SVG <path> element containing many segments. The path tokenizer repeatedly slices and rescans the entire path string, and the marker drawing logic repeatedly removes items from the front of a list, leading to excessive CPU consumption. The result is that processing a sub‑megabyte SVG can exhaust system resources and halt rendering applications. This flaw is classified as CWE‑407 (Excessive Computation).

Affected Systems

The affected product is Kozea's CairoSVG, versions earlier than 2.9.1. Applications that use CairoSVG’s svg2png, svg2pdf, or svg2ps APIs are directly vulnerable. Any process that renders attacker‑controlled SVG files can be impacted. The vulnerability is fixed in release 2.9.1 and later.

Risk and Exploitability

The CVSS v3.1 score of 8.7 indicates high severity. No EPSS score is publicly available, and the vulnerability is not listed in CISA’s KEV catalog. The likely attack vector involves providing a crafted SVG to a rendering application, a task that an attacker can perform through file uploads, email attachments, or web requests. Because the flaw manifests during normal rendering, the exploit is straightforward for anyone who can feed SVG data to the vulnerable library, making it a high‑risk denial‑of‑service attack.

Generated by OpenCVE AI on October 8, 2026 at 19:38 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade CairoSVG to version 2.9.1 or later.
  • Limit or sandbox the rendering process, applying CPU or time quotas to prevent resource exhaustion when processing untrusted SVG files.
  • Validate or sanitize the <path> data before rendering, or replace CairoSVG with an alternative library that imposes stricter limits on SVG complexity.

Generated by OpenCVE AI on October 8, 2026 at 19:38 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-c3jg-qh8m-j3h2 CairoSVG: Quadratic-time DoS parsing a crafted SVG <path>
History

Thu, 08 Oct 2026 21:30:00 +0000

Type Values Removed Values Added
First Time appeared Kozea
Kozea cairosvg
Vendors & Products Kozea
Kozea cairosvg

Thu, 08 Oct 2026 18:15:00 +0000

Type Values Removed Values Added
Description 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.
Title CairoSVG: Quadratic-time DoS parsing a crafted SVG <path>
Weaknesses CWE-407
References
Metrics cvssV4_0

{'score': 8.7, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-08T18:31:17.147Z

Reserved: 2026-10-07T21:07:54.987Z

Link: CVE-2026-107378

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-08T18:17:23.417

Modified: 2026-10-08T21:33:42.423

Link: CVE-2026-107378

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-08T21:15:13Z

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity