CVE-2026-31899 CairoSVG vulnerable to Exponential DoS via recursive <use> element amplification

High 7.5 Published Updated

An attacker can cause CPU exhaustion and denial of service by submitting a crafted SVG file with recursive use elements to applications using CairoSVG.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-31899?

CVE-2026-31899 is a high-severity denial of service vulnerability in Kozea CairoSVG, published on 13 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-674

Which versions are affected by CVE-2026-31899?

3 open source packages ship an affected version, including cairosvg and CairoSVG. It affects 1 product.

PackageAffectedFixed in
cairosvg PyPIAll versions2.9.0
cairosvg PyPIAll versions2.9.0
CairoSVG PyPIAll versions2.9.0
Linux distribution packages (6)
python-CairoSVG SUSE:Linux Enterprise Module for Python 3 15 SP7All versions2.7.1-150400.9.6.1
python-CairoSVG SUSE:Linux Enterprise Server 16.0All versions2.7.1-160000.3.1
python-CairoSVG SUSE:Linux Enterprise Server for SAP applications 16.0All versions2.7.1-160000.3.1
python-CairoSVG openSUSE:Leap 15.6All versions2.7.1-150400.9.6.1
ansible-creator openSUSE:TumbleweedAll versions26.8.0-1.1
python-CairoSVG openSUSE:TumbleweedAll versions2.9.0-1.1

Products include Courtbouillon Cairosvg.

How do I fix CVE-2026-31899?

Upgrade cairosvg to 2.9.0 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2026-31899 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-31899 exists.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as DEBIAN-CVE-2026-31899, GHSA-f38f-5xpm-9r7c, MGASA-2026-0104, PYSEC-2026-2122, ROOT-APP-PYPI-CVE-2026-31899, SUSE-SU-2026:1421-1 and 5 more.

Is CVE-2026-31899 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free