CVE-2021-28875
published 2021-04-11CVE-2021-28875: In the standard library in Rust before 1.50.0, read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer…
PriorityP340high7.5CVSS 3.1
AVNACLPRNUINSUCNINAH
EPSS
2.12%
79.8th percentile
In the standard library in Rust before 1.50.0, read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer overflow.
Affected
5 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | rustc | < rustc 1.53.0+dfsg1-1 (bookworm) | rustc 1.53.0+dfsg1-1 (bookworm) |
| msrc | cbl_mariner_1.0_arm | — | — |
| msrc | cbl_mariner_1.0_x64 | — | — |
| msrc | cm1_rust_1.47.0-3_on_cbl_mariner_1.0 | — | — |
| rust-lang | rust | < 1.50.0 | 1.50.0 |
CVSS provenance
nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
nvdv2.05.0MEDIUMAV:N/AC:L/Au:N/C:N/I:N/A:P
osv7.5HIGH
vendor_debian7.5HIGH
vendor_msrc7.5HIGH
vendor_redhat7.5HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Microsoft
In the standard library in Rust before 1.50.0 read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer overflow.
vendor_msrc·2021-04-13·CVSS 7.5
CVE-2021-28875 [HIGH] CWE-252 In the standard library in Rust before 1.50.0 read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer overflow.
In the standard library in Rust before 1.50.0 read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer overflow.
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this blog post for more information. If impact to additional products is identified, we will update the CVE to reflect this.
Mariner:
Red Hat
rust: heap-based buffer overflow in read_to_end() because it does not validate the return value from Read in an unsafe context
vendor_redhat·2021-01-10·CVSS 7.5
CVE-2021-28875 [HIGH] CWE-119 rust: heap-based buffer overflow in read_to_end() because it does not validate the return value from Read in an unsafe context
rust: heap-based buffer overflow in read_to_end() because it does not validate the return value from Read in an unsafe context
In the standard library in Rust before 1.50.0, read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer overflow.
Package: rust (Red Hat Enterprise Linux 9) - Not affected
Debian
CVE-2021-28875: rustc - In the standard library in Rust before 1.50.0, read_to_end() does not validate t...
vendor_debian·2021·CVSS 7.5
CVE-2021-28875 [HIGH] CVE-2021-28875: rustc - In the standard library in Rust before 1.50.0, read_to_end() does not validate t...
In the standard library in Rust before 1.50.0, read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer overflow.
Scope: local
bookworm: resolved (fixed in 1.53.0+dfsg1-1)
bullseye: open
forky: resolved (fixed in 1.53.0+dfsg1-1)
sid: resolved (fixed in 1.53.0+dfsg1-1)
trixie: resolved (fixed in 1.53.0+dfsg1-1)
GHSA
GHSA-fhrh-9gc2-pfgh: In the standard library in Rust before 1
ghsa_unreviewed·2022-05-24
CVE-2021-28875 [HIGH] CWE-252 GHSA-fhrh-9gc2-pfgh: In the standard library in Rust before 1
In the standard library in Rust before 1.50.0, read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer overflow.
OSV
CVE-2021-28875: In the standard library in Rust before 1
osv·2021-04-11·CVSS 7.5
CVE-2021-28875 [HIGH] CVE-2021-28875: In the standard library in Rust before 1
In the standard library in Rust before 1.50.0, read_to_end() does not validate the return value from Read in an unsafe context. This bug could lead to a buffer overflow.
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
2021-04-11
Published