CVE-2021-21236Regular Expression Denial of Service in CairoSVG
CairoSVG is a Python (pypi) package. CairoSVG is an SVG converter based on Cairo. In CairoSVG before version 2.5.1, there is a regular expression denial of service (REDoS) vulnerability. When processing SVG files, the python package CairoSVG uses two regular expressions which are vulnerable to Regular Expression Denial of Service (REDoS). If an attacker provides a malicious SVG, it can make cairosvg get stuck processing the file for a very long time. This is fixed in version 2.5.1. See Referenced GitHub advisory for more information.
What to do
Fixed builds are available from Alpine, Debian, PyPI: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | cairosvg | Fix pending | UBUNTU-CVE-2021-21236 | |
| Ubuntu 26.04 | cairosvg | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | cairosvg | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2021-21236 | |
| Ubuntu 24.04 | cairosvg | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | cairosvg | Fix pending | UBUNTU-CVE-2021-21236 | |
| Ubuntu 16.04 | cairosvg | Will not fix Ubuntu decided not to fix this in this release | ||
| Ubuntu 14.04 | cairosvg | Will not fix Ubuntu decided not to fix this in this release | ||
| Debian 14 | cairosvg | Fixed | 2.5.0-1.1 | DEBIAN-CVE-2021-21236 |
| Debian 13 | cairosvg | Fixed | 2.5.0-1.1 | DEBIAN-CVE-2021-21236 |
| Debian 12 | cairosvg | Fixed | 2.5.0-1.1 | DEBIAN-CVE-2021-21236 |
| Alpine Linux 3.24 | py3-cairosvg | Fixed | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine Linux 3.23 | py3-cairosvg | Fixed | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine Linux 3.22 | py3-cairosvg | Fixed | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine Linux 3.21 | py3-cairosvg | Fixed | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine Linux 3.20 | py3-cairosvg | Fixed | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine Linux 3.19 | py3-cairosvg | Fixed | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine Linux 3.18 | py3-cairosvg | Fixed | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| PyPI library | cairosvg | Fixed | 2.5.1 | GHSA-hq37-853p-g5cf |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Kozea CairoSVG: affected: < 2.5.1
References
- https://github.com/Kozea/CairoSVG/security/advisories/GHSA-hq37-853p-g5cf
- https://pypi.org/project/CairoSVG/
- https://github.com/Kozea/CairoSVG/commit/cfc9175e590531d90384aa88845052de53d94bf3
- https://github.com/Kozea/CairoSVG/releases/tag/2.5.1
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.