CVE-2021-21236
MEDIUM 5.5CVSS 3.1Regular Expression Denial of Service in CairoSVG
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.
- Published
- 6 Jan 2021
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-400
- Also known as
- GHSA-hq37-853p-g5cfPYSEC-2021-5
- Sources
- NVDJSONOSV GHSA-hq37-853p-g5cfJSONOSV PYSEC-2021-5JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P | |
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.7 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.5 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | courtbouillon | cairosvgcpe:2.3:a:courtbouillon:cairosvg:*:*:*:*:*:*:*:* |
< 2.5.1 | 2.5.1 |
| OSV | PyPI | cairosvg | < 2.5.1 | 2.5.1 |
References
- https://github.com/Kozea/CairoSVG/commit/cfc9175e590531d90384aa88845052de53d94bf3 · Patch, Third Party Advisory, WEB, FIX
- https://github.com/Kozea/CairoSVG/releases/tag/2.5.1 · Release Notes, Third Party Advisory, WEB
- https://github.com/Kozea/CairoSVG/security/advisories/GHSA-hq37-853p-g5cf · Exploit, Third Party Advisory, WEB, ADVISORY
- https://pypi.org/project/CairoSVG/ · Product, Third Party Advisory, WEB, PACKAGE
- https://nvd.nist.gov/vuln/detail/CVE-2021-21236 · ADVISORY
- https://github.com/Kozea/CairoSVG · PACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/cairosvg/PYSEC-2021-5.yaml · WEB
History
- 25 Nov 2026 20:32 UTC · NVD: first stored (published 6 Jan 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 6 Jan 2021)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 6 Jan 2021)