Vulnerability · Published Jan 6, 2021 · Assigned by GitHub_M
CVE-2021-21236Regular Expression Denial of Service in CairoSVG
Medium 5.7
In plain English
A medium-severity uncontrolled resource consumption in CairoSVG from Kozea. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.4% (higher than 72% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | py3-cairosvg | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine:v3.21 | py3-cairosvg | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine:v3.22 | py3-cairosvg | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine:v3.23 | py3-cairosvg | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Alpine:v3.24 | py3-cairosvg | 2.5.1-r0 | ALPINE-CVE-2021-21236 |
| Debian:12 | cairosvg | 2.5.0-1.1 | DEBIAN-CVE-2021-21236 |
| Debian:13 | cairosvg | 2.5.0-1.1 | DEBIAN-CVE-2021-21236 |
| Debian:14 | cairosvg | 2.5.0-1.1 | DEBIAN-CVE-2021-21236 |
| PyPI | cairosvg | 2.5.1 | PYSEC-2021-5 |
| PyPI | cairosvg | 2.5.1 | GHSA-hq37-853p-g5cf |
| Ubuntu:25.10 | cairosvg | no fix listed | UBUNTU-CVE-2021-21236 |
| Ubuntu:26.10 | cairosvg | no fix listed | UBUNTU-CVE-2021-21236 |
Affected products (as reported)
Weakness: CWE-400 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
References
- https://github.com/Kozea/CairoSVG/security/advisories/GHSA-hq37-853p-g5cf x_refsource_CONFIRM
- https://pypi.org/project/CairoSVG/ x_refsource_MISC
- https://github.com/Kozea/CairoSVG/commit/cfc9175e590531d90384aa88845052de53d94bf3 x_refsource_MISC
- https://github.com/Kozea/CairoSVG/releases/tag/2.5.1 x_refsource_MISC