CVE-2021-21236
HIGH7.5EPSS 0.14%Regular Expression Denial of Service in CairoSVG
Published: 1/6/2021Modified: 4/28/2026
Description
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.
Affected packages (3)
- Debian/cairosvgfrom 0, < 2.5.0-1.1
- PyPI/cairosvgfrom 0, < 2.5.1
- PyPI/cairosvgfrom 0, < cfc9175e590531d90384aa88845052de53d94bf3 | from 0, < 2.5.1
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 4.0 | — | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P |
| osv | CVSS 3.1 | HIGH7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
References (9)
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2021-21236
- ADVISORYhttps://security-tracker.debian.org/tracker/CVE-2021-21236
- PATCHhttps://github.com/Kozea/CairoSVG
- PATCHhttps://pypi.org/project/CairoSVG/
- WEBhttps://github.com/Kozea/CairoSVG/commit/cfc9175e590531d90384aa88845052de53d94bf3
- WEBhttps://github.com/Kozea/CairoSVG/releases/tag/2.5.1
- WEBhttps://github.com/Kozea/CairoSVG/security/advisories/GHSA-hq37-853p-g5cf
- WEBhttps://github.com/pypa/advisory-database/tree/main/vulns/cairosvg/PYSEC-2021-5.yaml
- WEBhttps://pypi.org/project/CairoSVG