CVE-2021-21236: Regular Expression Denial of Service in CairoSVG
Vulnerability summary
CVE-2021-21236 is a medium (CVSS 5.7) Uncontrolled Resource Consumption vulnerability in courtbouillon cairosvg. EPSS estimates a 1.37% chance of exploitation in the next 30 days, higher than 72.9% of scored vulnerabilities. 1 public exploit is recorded.
Not severe (CVSS 5.7, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 3 · Related 3Timeline
- 06-01-2021PublishedVulnerability first disclosed.
- 03-08-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
8 scores · 6 sources · 3 versions- OSV · PypiEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HDiffers
- OSV · UbuntuEcosystem advisory · calculated5.5MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:HDiffers
- OSV · DebianEcosystem advisory · calculated5.5MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:HDiffers
- NVDNIST5.5MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:HDiffers
- OSV · AlpineEcosystem advisory · calculated5.5MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:HDiffers
EPSS trend
Probability
1.37%
Chance of exploitation in the next 30 days
Percentile
73%
Versus all other CVEs
30-day change
Increase +0.01 pp
From 1.37% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundCairosvg
Maturity: poc
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, low-privilege account, user interaction (CVSS vector). Other conditions: not stated in public data.
Alpine1 product
- py3-cairosvg< 2.5.1-r0
Courtbouillon1 product
- cairosvg< 2.5.1
Debian1 product
- cairosvg< 2.5.0-1.1
Kozea1 product
- cairosvg< 2.5.1
Mageia1 product
- python-cairosvg< 2.2.1-1.1.mga7
PyPI1 product
- cairosvg< cfc9175e590531d90384aa88845052de53d94bf3 | < 2.5.1
Ubuntu1 product
- cairosvgAll versions (No fix recorded)
7 vendors · 7 products
References
16 links- github.com/Kozea/CairoSVG/security/advisories/GHSA-hq37-853p-g5cfX Refsource CONFIRMWEBAdvisoryREPORTExploitThird Party Advisory
- github.com/Kozea/CairoSVG/commit/cfc9175e590531d90384aa88845052de53d94bf3X Refsource MISCWEBFIXREPORTPatchThird Party Advisory
- github.com/Kozea/CairoSVG/releases/tag/2.5.1X Refsource MISCWEBREPORTRelease NotesThird Party Advisory
- github.com/Kozea/CairoSVGPACKAGE