CVE-2026-31899: Kozea CairoSVG · Uncontrolled Recursion
Affects Kozea CairoSVGSource CVE Database V5
Not known to be exploited · CVSS 7.5 High : upgrade to 2.9.0 soon.
Data as of 30 Oct 2026, 06:59 UTC
- EPSS
- 0.5% chance of exploitation in 30 days – higher than 43% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 2.9.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HExploitation evidence
Disclosed: evidence found.
CVE published 13 Mar 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: evidence found.
Public exploit code: GitHub proofs of concept
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), GitHub proofs of concept, the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.
What to do
Upgrade CairoSVG and cairosvg to 2.9.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| KozeaCairoSVG | Affected
| Fixed in
|
PyPIcairosvgpkg:pypi/cairosvgOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
To mitigate CVE-2026-31899, organizations should immediately upgrade CairoSVG to version 2.9.0 or later, where the uncontrolled recursion issue has been addressed. If upgrading is not immediately feasible, implement strict input validation to reject SVG files containing recursive <use> elements or excessively nested references. Employ resource limits such as CPU timeouts or process isolation when processing SVG files to prevent a single malicious input from exhausting system resources. Monitor CPU usage patterns and application logs for signs of abnormal resource consumption during SVG processing. Consider sandboxing SVG rendering processes to contain potential denial of service impacts. Additionally, review and harden any web services or APIs that accept SVG uploads to ensure they do not process untrusted files without proper sanitization. Maintain awareness of updates from the Kozea project and security advisories for any patches or mitigations. Finally, educate development and operations teams about the risks of processing untrusted SVG content and incorporate secure coding practices to handle recursive structures safely.
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.