Related Vulnerabilities: CVE-2021-28876  

In the standard library in Rust before 1.52.0, the Zip implementation has a panic safety issue. It calls __iterator_get_unchecked() more than once for the same index when the underlying iterator panics (in certain conditions). This bug could lead to a memory safety violation due to an unmet safety requirement for the TrustedRandomAccess trait.

Severity Medium

Remote No

Type Incorrect calculation

Description

In the standard library in Rust before 1.52.0, the Zip implementation has a panic safety issue. It calls __iterator_get_unchecked() more than once for the same index when the underlying iterator panics (in certain conditions). This bug could lead to a memory safety violation due to an unmet safety requirement for the TrustedRandomAccess trait.

AVG-1801 rust 1.51.0-1 Medium Vulnerable

https://github.com/rust-lang/rust/issues/81740
https://github.com/rust-lang/rust/pull/81741
https://github.com/rust-lang/rust/commit/0cfba2fd090834c909d5ed9deccdee8170da791b