Vulnerabilities

Vulnerability · CVE-2026-107378

CairoSVG: Quadratic-time DoS parsing a crafted SVG

Published Oct 8, 2026 · catalog updated Oct 15, 2026 · CairoSVG: Quadratic-time DoS parsing

Check if you run it

No confirmed exploitation is on record for CVE-2026-107378. EPSS is 0.38%. Act only if a listed version of CairoSVG: Quadratic-time DoS parsing is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (CairoSVG: Quadratic-time DoS parsing).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
High—
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.38%
Remediation
Advisory link
Affected products
PyPI cairosvg

## Summary Rendering an untrusted SVG whose contains many segments is O(n²) CPU. A single under 1 MiB burns tens of seconds. Two independent O(n²) sites in : 1. **Tokenizer** — the path-data parser consumes the string with a 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 with ; is O(n), so draining n vertices is O(n²). Both are hit on a normal render path ( / ), attacker controls only the SVG document. ## PoC (installed cairosvg 2.9.0) | path segments | SVG size | time | |---|---|---| | 50,000 | 244 KB | 1.14 s | | 100,000 | 488 KB | 4.36 s | | 200,000 | ~960 KB | ~18 s | Doubling segments ≈ 4× time ⇒ quadratic. Sub-MiB input ⇒ ~18 s CPU; any service rendering user-supplied SVG (thumbnails, avatars, PDF export) is a DoS target. ## Reachability Public API / / on an untrusted SVG string. ## Suggested fix Tokenize with a single forward scan / index (or ) instead of re-slicing the remainder; drain with an index or instead of . Optionally cap path-segment count.

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • PyPI cairosvg0 → 2.9.1

How to fix CVE-2026-107378

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-107378. EPSS is 0.38%. Act only if a listed version of CairoSVG: Quadratic-time DoS parsing is installed.

Which versions are affected?

Compare what you have installed with 0 → 2.9.1. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-407. EPSS 0.38%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Oct 8, 2026 · GitHub Advisory Database

    Detected

    ## Summary Rendering an untrusted SVG whose contains many segments is O(n²) CPU. A single under 1 MiB burns tens of seconds. Two independent O(n²) sites in : 1. **Tokenizer** — the path-data parser consumes the string with a 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 drain

  2. Oct 15, 2026 · GitHub Advisory Database

    Fix available

    cairosvg fixed in 2.9.1

  3. Oct 15, 2026 · GitHub Advisory Database

    Fix available

    cairosvg fixed in 2.9.1

  4. Oct 15, 2026 · GitHub Advisory Database

    Updated

    ## Summary Rendering an untrusted SVG whose contains many segments is O(n²) CPU. A single under 1 MiB burns tens of seconds. Two independent O(n²) sites in : 1. **Tokenizer** — the path-data parser consumes the string with a 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 drain

Sources

References

Freshness

Last verified in this catalog Oct 18, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.