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.

Severity (CVSS 3.1)5.7Medium
Exploit odds (30 days)1.4%top 28.0% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Alpine:v3.20py3-cairosvg2.5.1-r0ALPINE-CVE-2021-21236
Alpine:v3.21py3-cairosvg2.5.1-r0ALPINE-CVE-2021-21236
Alpine:v3.22py3-cairosvg2.5.1-r0ALPINE-CVE-2021-21236
Alpine:v3.23py3-cairosvg2.5.1-r0ALPINE-CVE-2021-21236
Alpine:v3.24py3-cairosvg2.5.1-r0ALPINE-CVE-2021-21236
Debian:12cairosvg2.5.0-1.1DEBIAN-CVE-2021-21236
Debian:13cairosvg2.5.0-1.1DEBIAN-CVE-2021-21236
Debian:14cairosvg2.5.0-1.1DEBIAN-CVE-2021-21236
PyPIcairosvg2.5.1PYSEC-2021-5
PyPIcairosvg2.5.1GHSA-hq37-853p-g5cf
Ubuntu:25.10cairosvgno fix listedUBUNTU-CVE-2021-21236
Ubuntu:26.10cairosvgno fix listedUBUNTU-CVE-2021-21236

Affected products (as reported)

VendorProductVersions
Kozea CairoSVG < 2.5.1

Weakness: CWE-400 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H

References