# CVE-2021-21236: Regular Expression Denial of Service in CairoSVG

- Priority: **Routine**
- Reason: Not severe (CVSS 5.7, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2021-01-06 · Modified: 2024-08-03
- Aliases: MGASA-2021-0149, GHSA-hq37-853p-g5cf, PYSEC-2021-5, UBUNTU-CVE-2021-21236, DEBIAN-CVE-2021-21236, ALPINE-CVE-2021-21236
- Record: https://cvemate.com/vulnerability/CVE-2021-21236 · JSON: https://cvemate.com/vulnerability/CVE-2021-21236/json

## Description

```text
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.
```

## Signals

- CVSS: 5.7 medium (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
- EPSS: 1.374%, percentile 72.944%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected

- alpine py3-cairosvg (Alpine Linux): \< 2.5.1-r0
- courtbouillon cairosvg: \< 2.5.1
- debian cairosvg (Debian): \< 2.5.0-1.1
- ubuntu cairosvg (Ubuntu): All versions (No fix recorded)
- kozea cairosvg: \< 2.5.1
- mageia python-cairosvg (Mageia): \< 2.2.1-1.1.mga7
- PyPI cairosvg (PyPI): \< cfc9175e590531d90384aa88845052de53d94bf3 \| \< 2.5.1

## References

- <https://github.com/Kozea/CairoSVG/security/advisories/GHSA-hq37-853p-g5cf>
- <https://pypi.org/project/CairoSVG/>
- <https://github.com/Kozea/CairoSVG/commit/cfc9175e590531d90384aa88845052de53d94bf3>
- <https://github.com/Kozea/CairoSVG/releases/tag/2.5.1>
- <https://advisories.mageia.org/MGASA-2021-0149.html>
- <https://bugs.mageia.org/show_bug.cgi?id=28122>
- <https://github.com/advisories/GHSA-hq37-853p-g5cf>
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21236>
- <https://github.com/Kozea/CairoSVG>
- <https://github.com/pypa/advisory-database/tree/main/vulns/cairosvg/PYSEC-2021-5.yaml>
- <https://pypi.org/project/CairoSVG>
- <https://ubuntu.com/security/CVE-2021-21236>
- <https://github.com/Kozea/CairoSVG/commit/063185b60588a41d4df661ad70f9f7b699901abc>
- <https://www.cve.org/CVERecord?id=CVE-2021-21236>
- <https://security-tracker.debian.org/tracker/CVE-2021-21236>
- <https://security.alpinelinux.org/vuln/CVE-2021-21236>

---

Data as of 2026-12-05T06:48:34.668Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
