CVE-2021-28877: In the standard library in Rust before 1.51.0, the Zip implementation calls __iterator_get_unchecked() for the same index more than once when nested.
High CVSS 7.5
- CVE id
- CVE-2021-28877
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| Rust Runtimes and servers |
< 1.51.0 | 1.51.0 |
How to fix it
Upgrade Rust to 1.51.0 or later.
rustc --version
- Build with the patched Rust toolchain (rustup update, or rust-toolchain.toml) and redeploy.
A free AIssue account reads the runtime versions your repositories pin (version files, Dockerfiles, build files) and tells you when one is affected.
Details
In the standard library in Rust before 1.51.0, the Zip implementation calls __iteratorgetunchecked() for the same index more than once when nested. This bug can lead to a memory safety violation due to an unmet safety requirement for the TrustedRandomAccess trait.
References
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: National Vulnerability Database (NVD) (public domain). Severity comes from the advisory's own rating when it has one, else from its CVSS score.