CVE-2021-45705 Aliased mutable references from `tls_rand` & `TlsWyRand`
The nanorand Rust library allows multiple mutable references to the same object, potentially leading to memory corruption and undefined behavior.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-45705?
CVE-2021-45705 is a critical memory corruption vulnerability in n/a, published on 26 Dec 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
An issue was discovered in the nanorand crate before 0.6.1 for Rust. There can be multiple mutable references to the same object because the TlsWyRand Deref implementation dereferences a raw pointer.
Which versions are affected by CVE-2021-45705?
5 open source packages ship an affected version, including nanorand. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
nanorand crates.io | From 0.5.0 | 0.6.1 |
nanorand crates.io | From 0.5.0 | 0.6.1 |
nanorand crates.io | From 0.5.0 | 0.6.1 |
nanorand crates.io | From 0.5.0 | 0.6.1 |
nanorand crates.io | From 0.5.0 | 0.6.1 |
Products include Nanorand Project Nanorand.
How do I fix CVE-2021-45705?
Upgrade nanorand to 0.6.1 or later.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2021-45705 being exploited?
There is no known exploitation of CVE-2021-45705 in the wild and no public exploit code.
Other vulnerabilities in n/a
Sources
Also known as GHSA-p6gj-gpc8-f8xw, GHSA-r57r-j98g-587f, RUSTSEC-2021-0114.