Update dependency cairosvg to v2.9.0 [SECURITY]#67
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
Update dependency cairosvg to v2.9.0 [SECURITY]#67renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==2.6.0→==2.9.0CairoSVG improperly processes SVG files loaded from external resources
CVE-2023-27586 / GHSA-rwmf-w63j-p7gv
More information
Details
SSRF vulnerability
Summary
When CairoSVG processes an SVG file, it can make requests to the inner host and different outside hosts.
Operating system, version and so on
Linux, Debian (Buster) LTS core 5.10 / Parrot OS 5.1 (Electro Ara), python 3.9
Tested CairoSVG version
2.6.0
Details
A specially crafted SVG file that loads an external resource from a URL. Remote attackers could exploit this vulnerability to cause a scan of an organization's internal resources or a DDOS attack on external resources.
It looks like this bug can affect websites and cause request forgery on the server.
PoC
1.1 CairoSVG_exploit.svg:
1.2 CairoSVG_exploit_2.svg:
1.3 CairoSVG_exploit_3.svg:
Run some commands:
$ python3 -m cairosvg CairoSVG_exploit.svg -f png$ python3 -m cairosvg CairoSVG_exploit_2.svg -f png$ python3 -m cairosvg CairoSVG_exploit_3.svg -f pngSee result requests in Burp Collaborator:

DOS vulnerability with SSTI
Summary
When CairoSVG processes an SVG file, it can send requests to external hosts and wait for a response from the external server after a successful TCP handshake. This will cause the server to hang.
It seems this bug can affect websites or servers and cause a complete freeze while uploading this PoC file to the server.
Operating system, version and so on
Linux, Debian (Buster) LTS core 5.10 / Parrot OS 5.1 (Electro Ara), python 3.9
Tested CairoSVG version
2.6.0
PoC
$timeout 60 python3 -m cairosvg CairoSVG_exploit_dos.svg -f png(without timeout server will hang forever)
DOS vulnerability with stdin file descriptor
Summary
Specially crafted SVG file that opens /proc/self/fd/1 or /dev/stdin results in a hang with a tiny PoC file. Remote attackers could leverage this vulnerability to cause a denial of service via a crafted SVG file.
It seems this bug can affect websites or servers and cause a complete freeze while uploading this PoC file to the server.
Operating system, version and so on
Linux, Debian (Buster) LTS core 5.10 / Parrot OS 5.1 (Electro Ara), python 3.9
Tested CairoSVG version
2.6.0
PoC
$timeout 60 python3 -m cairosvg cariosvg_exploit_dos.svg -f pngSeverity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:H/SA:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
CairoSVG vulnerable to Exponential DoS via recursive element amplification
CVE-2026-31899 / GHSA-f38f-5xpm-9r7c
More information
Details
Summary
Kozea/CairoSVG (~300K downloads/week) has exponential denial of service via recursive
<use>element amplification incairosvg/defs.py(line ~335). This causes CPU exhaustion from a small input.Severity
High — CVSS 3.1: 7.5
Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HVulnerable Code
File:
cairosvg/defs.py(line ~335), functionuse()The
use()function recursively processes<use>elements without any depth or count limits. With 5 levels of nesting and 10 references each, a 1,411-byte SVG triggers 10^5 = 100,000 render calls.Impact
Proof of Concept
Save as
poc.svgand runtimeout 10 cairosvg poc.svg -o test.png:Expected:
timeoutkills the process after 10 seconds (it never completes on its own).Alternatively test with Python:
Suggested Fix
Add recursion depth counter to
use()function. Cap at e.g. 10 levels. Also add total element budget to prevent amplification.References
Credit
Kai Aizen (SnailSploit) — Adversarial AI & Security Research
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
Kozea/CairoSVG (cairosvg)
v2.9.0Compare Source
WARNING: this is a security update.
Using a lot of recursively nested use tags could lead to long rendering times with relatively small inputs.
CairoSVG now stops rendering when more than 100k use tags are rendered.
Using the --unsafe option allows to render larger documents.
v2.8.2Compare Source
v2.8.1Compare Source
v2.8.0Compare Source
v2.7.1Compare Source
v2.7.0Compare Source
WARNING: this is a security update.
When processing SVG files, CairoSVG could access other files online, possibly leading to very long renderings or other security problems.
This feature is now disabled by default. External resources can still be accessed using the "unsafe" or the "url_fetcher" parameter.
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.