CVE-2020-35875 is a high-severity (CVSS 7.5) vulnerability in tokio-rustls. A fix is available for tokio-rustls — see the affected versions and patch details below.
Excessive memory usage in tokio-rustls
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
tokio-rustls🦀tokio-rustlsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
tokio-rustls does not call process_new_packets immediately after read, so the expected termination condition wants_read always returns true. As long as new incoming data arrives faster than it is processed and the reader does not return pending, data will be buffered. This may cause DoS.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | tokio-rustls | ≥ 0.12.0&&< 0.12.3 | 0.12.3cargo update -p tokio-rustls --precise 0.12.3 |
| 🦀crates.io | tokio-rustls | ≥ 0.13.0&&< 0.13.1 | 0.13.1cargo update -p tokio-rustls --precise 0.13.1 |
Affected Products
tokio-rustlstokioDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for tokio-rustls, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update tokio-rustls to 0.12.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2020-35875 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is CVE-2020-35875 in your dependencies?
Find it across crates.io, including transitive dependencies.