Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. CairoSVG
  4. ›
  5. CVE-2026-107378

CVE-2026-107378: CairoSVG: Quadratic-time DoS parsing a crafted SVG <path>

October 8, 2026

Rendering an untrusted SVG whose <path d="..."> contains many segments is O(n²) CPU. A single <path> under 1 MiB burns tens of seconds. Two independent O(n²) sites in cairosvg/path.py:

  1. Tokenizer — the path-data parser consumes the d string with a while string: loop that repeatedly slices/re-scans the remaining string (each step is O(len remaining)), giving O(n²) over the whole attribute.
  2. draw_markers — marker handling drains node.vertices with while node.vertices: ... node.vertices.pop(0); list.pop(0) is O(n), so draining n vertices is O(n²).

Both are hit on a normal render path (svg2png/svg2pdf), attacker controls only the SVG document.

References

  • github.com/Kozea/CairoSVG/commit/9d63f049f9988d0ddda3eb94564ac3a50a286523
  • github.com/Kozea/CairoSVG/commit/a4d585eb374724b79676e9cceaa9e9a1a4358565
  • github.com/Kozea/CairoSVG/releases/tag/2.9.1
  • github.com/Kozea/CairoSVG/security/advisories/GHSA-c3jg-qh8m-j3h2
  • github.com/advisories/GHSA-c3jg-qh8m-j3h2
  • nvd.nist.gov/vuln/detail/CVE-2026-107378

Code Behaviors & Features

Detect and mitigate CVE-2026-107378 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 2.9.1

Fixed versions

  • 2.9.1

Solution

Upgrade to version 2.9.1 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-407: Inefficient Algorithmic Complexity

Source file

pypi/CairoSVG/CVE-2026-107378.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:52 +0000.