CVE-2021-21236: Regular Expression Denial of Service in CairoSVG
Noroxi assessment
Priority: Monitor (action score 22/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 1.3% (FIRST EPSS); higher than 72.2% of all records.
- Someone with local access to the system can trigger it. No account or password is required. A user must open a link or visit a page. No special conditions are required; it is repeatable.
- Fixed version: Kozea CairoSVG 2.5.1.
Low priority for now. Upgrade to Kozea CairoSVG 2.5.1 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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
- Jan 6, 2021
- Updated
- Jun 16, 2026
- EPSS
- 1.3% · 72th percentile
- CWE
- CWE-400
Report tools
Action score
22
Low priority for now.
- CVSS
- 22 / 40 · 5.5 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 1.3%
CNA vs NVD score
- NVD
- 5.5
- CNA · GitHub_M
- 5.7
- 0.2 point gap
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| courtbouillon | cairosvg | cpe:2.3:a:courtbouillon:cairosvg |
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
Kozea CairoSVG
- < 2.5.1affected
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- courtbouillon cairosvgbefore 2.5.1
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Alpine:v3.18 | py3-cairosvg | before 2.5.1-r0 | 2.5.1-r0 |
| Debian:12 | cairosvg | before 2.5.0-1.1 | 2.5.0-1.1 |
| openSUSE:Leap 15.4 | python-CairoSVG | before 2.5.2-bp154.2.3.1 | 2.5.2-bp154.2.3.1 |
| openSUSE:Leap 15.5 | python-CairoSVG | before 2.5.2-bp155.3.3.1 | 2.5.2-bp155.3.3.1 |
| openSUSE:Tumbleweed | python-CairoSVG | before 2.9.0-1.3 | 2.9.0-1.3 |
| PyPI | cairosvg | before 2.5.1 | 2.5.1 |
| SUSE:Package Hub 15 SP4 | python-CairoSVG | before 2.5.2-bp154.2.3.1 | 2.5.2-bp154.2.3.1 |
| SUSE:Package Hub 15 SP5 | python-CairoSVG | before 2.5.2-bp155.3.3.1 | 2.5.2-bp155.3.3.1 |
Same product
courtbouillon: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-31899CairoSVG vulnerable to Exponential DoS via recursive <use> element amplification30Monitor
- CVE-2023-27586CairoSVG improperly processes SVG files loaded from external resources28Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| Kozea CairoSVG | 2.5.1 · description | Vendor (CNA) |
| alpine:py3-cairosvg | 2.5.1-r0 · Alpine:v3.18 | Package registry (OSV) |
| debian:cairosvg | 2.5.0-1.1 · Debian:12 | Package registry (OSV) |
| opensuse:python-CairoSVG | 2.5.2-bp155.3.3.1 · openSUSE:Leap 15.5 | Package registry (OSV) |
| PyPI:cairosvg | 2.5.1 | Package registry (OSV) |
| suse:python-CairoSVG | 2.5.2-bp155.3.3.1 · SUSE:Package Hub 15 SP5 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Someone with local access to the system can trigger it.
- No account or password is required.
- A user must open a link or visit a page.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- none
- Availability
- high · the service can be disrupted
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- None
- Availability impact
- High
Weakness class (CWE)
CWE-400 · Uncontrolled Resource ConsumptionCVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
nvd-primary
Root cause
Code that parses nested structures sets no depth or size limit. A small input can turn into a disproportionate processing load.
The bug in code
The whole CWE-400 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
function expand(node) {
return node.children.map(expand);
}Fixed
const MAX_DEPTH = 32;
function expand(node, depth = 0) {
if (depth > MAX_DEPTH) throw new Error("too deep");
return node.children.map((c) => expand(c, depth + 1));
}Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (2 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.