CVE-2021-21236 Regular Expression Denial of Service in CairoSVG
An attacker can cause a denial of service by providing a malicious SVG file that triggers excessive CPU usage in the CairoSVG library.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-21236?
CVE-2021-21236 is a medium-severity denial of service vulnerability in Kozea CairoSVG, published on 6 Jan 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
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.
Weakness: CWE-400
Which versions are affected by CVE-2021-21236?
3 open source packages ship an affected version, including cairosvg and CairoSVG. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
cairosvg PyPI | All versions | 2.5.1 |
cairosvg PyPI | All versions | 2.5.1 |
CairoSVG PyPI | All versions | 2.5.1 |
Products include Courtbouillon Cairosvg.
How do I fix CVE-2021-21236?
Upgrade cairosvg to 2.5.1 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2021-21236 being exploited?
There is no known exploitation of CVE-2021-21236 in the wild and no public exploit code.
Other vulnerabilities in Kozea CairoSVG
Sources
Also known as DEBIAN-CVE-2021-21236, GHSA-hq37-853p-g5cf, MGASA-2021-0149, PYSEC-2021-5, UBUNTU-CVE-2021-21236.