PT-2021-14348

CVE-2021-21236

·

Published

2021-01-06

·

Updated

2026-10-31

Description by

CVSS 4.0
7.7
High
MetricsAV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P
Name of the Vulnerable Software and Affected Versions: CairoSVG versions prior to 2.5.1
Description: The issue is related to a regular expression denial of service (REDoS) vulnerability in CairoSVG, a Python package used for converting SVG files. When processing SVG files, CairoSVG uses two regular expressions that are vulnerable to Regular Expression Denial of Service (REDoS). If an attacker provides a malicious SVG, it can cause CairoSVG to get stuck processing the file for a very long time. The vulnerability is caused by the complexity of the regular expressions, which can lead to catastrophic backtracking when processing a long string of spaces. The complexity is cubic, meaning that doubling the length of the malicious string of spaces makes processing take 8 times as long.
Recommendations: For versions prior to 2.5.1, update to version 2.5.1 or later to fix the regular expression denial of service (REDoS) vulnerability. As a temporary workaround, consider avoiding the use of the vulnerable regular expressions in the colors.py file until a patch is available. Restrict access to the cairosvg package to minimize the risk of exploitation. Avoid using malicious SVG files that can cause the package to get stuck processing the file for a very long time.
Exploitability
Exploit
Fix
Impacts
Researchers
Vendors
Affected products
Related identifiers
GHSA-HQ37-853P-G5CF
ALT-PU-2024-1459
CLEANSTART-2024-BA11082
MGASA-2021-0149
OPENSUSE-SU-2023:0260-1
OPENSUSE-SU-2023:0272-1
OPENSUSE-SU-2024:13218-1
OPENSUSE-SU-2026:11989-1
PYSEC-2021-5
Found an issue in the description? Have something to add? Feel free to write us 👾