Read the docs

Inefficient path parsing in CairoSVG enables denial of service

Priority HIGH 77CWE-407Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Attack requirements
None
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Fixed

Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-407.

Summary

CairoSVG versions before 2.9.1 are affected. Rendering an SVG whose path contains many segments causes quadratic CPU consumption from inefficient algorithmic complexity (CWE-407). An unauthenticated remote attacker can supply a sub-megabyte SVG to svg2png, svg2pdf or svg2ps, consuming substantial CPU and denying service to the rendering application.

Written with Claude Haiku 5.5 from the sources below · 2026-10-29

Description from the CNA

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00383 32nd percentileScored 2026-11-07
Fix Fixed CairoSVG (Kozea): 2.9.1cairosvg (PyPI): 2.9.1

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
Yes
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
KozeaCairoSVGbefore 2.9.12.9.1Patch availableCNA
—cairosvg (PyPI)before 2.9.12.9.1Patch availableGHSA-c3jg-qh8m-j3h2
  • CairoSVG VendorKozea Affected before 2.9.1 Fixed in 2.9.1 Patch available CNA
  • cairosvg (PyPI) Vendor— Affected before 2.9.1 Fixed in 2.9.1 Patch available GHSA-c3jg-qh8m-j3h2

CPE names Threatist (inferred) · 1

Inferred from how NVD named this product before; not given by a source.

CPEVersionsRoleVendor
cpe:2.3:a:courtbouillon:cairosvg:*:*:*:*:*:*:*:*——Courtbouillon
  • cpe:2.3:a:courtbouillon:cairosvg:*:*:*:*:*:*:*:* Versions — — ·Courtbouillon

Remediation

Upgrade the cairosvg package on PyPI to version 2.9.1, the fixed version listed for that package.

Written with Claude Haiku 5.5 from the sources below · 2026-10-29

  • Fix · CNA CairoSVG (Kozea) Fixed in 2.9.1
  • Fix · GHSA-c3jg-qh8m-j3h2 cairosvg (PyPI) Fixed in 2.9.1 Advisory →

Vendor assessments

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-08 Threatist record created from CVE-2026-107378
  2. 2026-10-09 Alias added: GHSA-c3jg-qh8m-j3h2
  3. 2026-10-09 Fix available: PyPI/[email protected] · GHSA-c3jg-qh8m-j3h2
  4. 2026-10-09 CVSS score added · GHSA-c3jg-qh8m-j3h2
  5. 2026-10-09 Weakness changed · GHSA-c3jg-qh8m-j3h2
  6. 2026-10-09 6 new references · GHSA-c3jg-qh8m-j3h2
  7. 2026-10-13 Affected versions changed · Red Hat
  8. 2026-10-13 CVSS score added · Red Hat

References

  • TI-2026-24451 CairoSVG vulnerable to Exponential DoS via recursive <use> element amplification CVSS 3.1HIGH 7.5
  • TI-2025-42134 WeasyPrint Vulnerable to Server-Side Request Forgery (SSRF) Protection Bypass via HTTP Redirect CVSS 3.1HIGH 7.5
  • TI-2026-36607 WeasyPrint: CSS Injection via Presentational Hints CVSS 3.1MEDIUM 6.5
  • TI-2026-39778 WeasyPrint restrictive URL fetcher bypass allows local file read and SSRF CVSS 3.1MEDIUM 6.2
  • TI-2023-12296 CairoSVG improperly processes SVG files loaded from external resources CVSS 3.1CRITICAL 9.9
  • TI-2026-68895 WeasyPrint passes EPS images to Ghostscript, risking code execution CVSS 3.1HIGH 8.8
See all 8 →

Sources