CVE-2021-21236

Regular Expression Denial of Service in CairoSVG

MEDIUM
5.5
CVSS Score
Published: January 6, 2021 at 05:00 PM UTC
Updated: June 17, 2026 at 03:35 AM UTC
2 products affected across 2 vendorsCairosvgCairoSVG

Using CairoSVG by Kozea?

Get instant alerts when new vulnerabilities affect CairoSVG - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 1%

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 2.5.1
Affected range stops below 2.5.1, so it looks safe — our inference, not a vendor statement
v < 2.5.1
Affected range stops below 2.5.1, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (4)

x_refsource_MISCRelease NotesThird Party Advisory
https://github.com/Kozea/CairoSVG/releases/tag/2.5.1
x_refsource_MISCProductThird Party Advisory
https://pypi.org/project/CairoSVG/

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-400

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card