# CVE-2021-21419: Improper Handling of Highly Compressed Data (Data Amplification) and Memory Allocation with Excessive Size Value in eventlet

> A malicious peer can exhaust memory in the eventlet library by sending large or highly compressed websocket frames, causing a denial of service.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 May 2021
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2021-21419, GHSA-9p9m-jm8w-94p2, MGASA-2021-0266, PYSEC-2021-12, RHSA-2021:5071, UBUNTU-CVE-2021-21419, USN-4956-1

## What is CVE-2021-21419?

CVE-2021-21419 is a medium-severity denial of service vulnerability in Fedoraproject Fedora, published on 7 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Eventlet is a concurrent networking library for Python. A websocket peer may exhaust memory on Eventlet side by sending very large websocket frames. Malicious peer may exhaust memory on Eventlet side by sending highly compressed data frame. A patch in version 0.31.0 restricts websocket frame to reasonable limits. As a workaround, restricting memory usage via OS limits would help against overall machine exhaustion, but there is no workaround to protect Eventlet process.

Weakness: CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2021-21419?

3 open source packages ship an affected version, including eventlet. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `eventlet` | PyPI | From 0.10 | 0.31.0 |
| `eventlet` | PyPI | From 0.10 | 0.31.0 |
| `eventlet` | PyPI | From 0.10.0 | 0.31.0 |
| `python-eventlet` | Red Hat:openstack:16.1::el8 | All versions | 0:0.25.2-5.el8ost.1 |
| `python3-eventlet` | Red Hat:openstack:16.1::el8 | All versions | 0:0.25.2-5.el8ost.1 |

Products: Eventlet Eventlet, Fedoraproject Fedora.

## How do I fix CVE-2021-21419?

Upgrade eventlet to 0.31.0 or later.

## Is CVE-2021-21419 being exploited?

There is no known exploitation of CVE-2021-21419 in the wild and no public exploit code.

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2025-58068](https://insights.sbomify.com/CVE-2025-58068/): Eventlet affected by HTTP request smuggling in unparsed trailers (medium 6.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-21419 and fix it if it is affected.

What it is: CVE-2021-21419 is a medium-severity denial of service vulnerability in Fedoraproject Fedora, published on 7 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-21419 in the wild and no public exploit code.

Affected packages and fixed versions:
- eventlet (PyPI): affected from 0.10; fixed in 0.31.0
- eventlet (PyPI): affected from 0.10; fixed in 0.31.0
- eventlet (PyPI): affected from 0.10.0; fixed in 0.31.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-21419/ (Markdown: https://insights.sbomify.com/CVE-2021-21419/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-21419
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-21419
- OSV: https://osv.dev/vulnerability/CVE-2021-21419

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-21419/
Summaries are generated and may contain mistakes; the official description above is the record.
