Description
CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive <use> element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.
Published: 2026-03-13
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service (CPU exhaustion)
Action: Apply patch
AI Analysis

Impact

CairoSVG contains a defect that allows an attacker to trigger exponential CPU exhaustion by including a recursively referenced <use> element in a crafted SVG file. This flaw is an instance of uncontrolled recursion (CWE-674) combined with resource management weaknesses (CWE-776). When the recursion is processed, the engine repeatedly expands the referenced element, rapidly consuming processing time and memory, which can lead to a denial‑of‑service condition for a server or application that renders the SVG.

Affected Systems

The vulnerability exists in the Kozea:CairoSVG library. Version information for affected releases is not explicitly listed in the data; therefore all releases prior to an available fix are considered vulnerable.

Risk and Exploitability

The CVSS score of 7.5 reflects a high severity, yet the EPSS score of less than 1% indicates a low probability of widespread exploitation at present. The flaw is not cataloged in CISA's KEV list. Exploitation requires delivery of a specially crafted SVG file that contains the recursive <use> amplification; the attack can be performed remotely if the application processes untrusted SVG input. When triggered, it results in high CPU usage and potential application or service downtime.

Generated by OpenCVE AI on March 18, 2026 at 16:24 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the latest CairoSVG release that contains the recursion mitigation patch
  • If an update cannot be applied immediately, reject or sanitize incoming SVG files that use the <use> element, or enforce strict size and recursion limits
  • Implement monitoring of CPU usage for the rendering process and apply rate limiting to mitigate heavy loads
  • Stay informed of vendor advisories and follow any additional recommended controls

Generated by OpenCVE AI on March 18, 2026 at 16:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-f38f-5xpm-9r7c CairoSVG vulnerable to Exponential DoS via recursive <use> element amplification
History

Wed, 18 Mar 2026 15:30:00 +0000

Type Values Removed Values Added
First Time appeared Courtbouillon
Courtbouillon cairosvg
CPEs cpe:2.3:a:courtbouillon:cairosvg:*:*:*:*:*:*:*:*
Vendors & Products Courtbouillon
Courtbouillon cairosvg

Mon, 16 Mar 2026 14:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 16 Mar 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-776
References
Metrics threat_severity

None

threat_severity

Important


Mon, 16 Mar 2026 10:15:00 +0000

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

Fri, 13 Mar 2026 20:00:00 +0000

Type Values Removed Values Added
Description CairoSVG is an SVG converter based on Cairo, a 2D graphics library. Prior to Kozea/CairoSVG has exponential denial of service via recursive <use> element amplification in cairosvg/defs.py. This causes CPU exhaustion from a small input.
Title CairoSVG vulnerable to Exponential DoS via recursive <use> element amplification
Weaknesses CWE-674
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}


Subscriptions

Courtbouillon Cairosvg
Kozea Cairosvg
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-03-16T13:39:14.684Z

Reserved: 2026-03-09T21:59:02.689Z

Link: CVE-2026-31899

cve-icon Vulnrichment

Updated: 2026-03-16T13:38:58.120Z

cve-icon NVD

Status : Analyzed

Published: 2026-03-13T19:54:38.190

Modified: 2026-03-18T15:16:48.653

Link: CVE-2026-31899

cve-icon Redhat

Severity : Important

Publid Date: 2026-03-13T19:38:43Z

Links: CVE-2026-31899 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-03-23T13:40:09Z

Weaknesses