logo

CVE-2021-28032 nano_arena

Package

Manager: cargo
Name: nano_arena
Vulnerable Version: >=0 <0.5.2

Severity

Level: Critical

CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

EPSS: 0.00418 pctl0.61024

Details

Use after free in nano_arena Affected versions of this crate assumed that Borrow<Idx> was guaranteed to return the same value on .borrow(). The borrowed index value was used to retrieve a mutable reference to a value. If the Borrow<Idx> implementation returned a different index, the split arena would allow retrieving the index as a mutable reference creating two mutable references to the same element. This violates Rust's aliasing rules and allows for memory safety issues such as writing out of bounds and use-after-frees. The flaw was corrected in commit `6b83f9d` by storing the .borrow() value in a temporary variable.

Metadata

Created: 2021-08-25T20:52:00Z
Modified: 2023-06-13T20:02:46Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-wp34-mqw5-jj85/GHSA-wp34-mqw5-jj85.json
CWE IDs: ["CWE-416"]
Alternative ID: GHSA-wp34-mqw5-jj85
Finding: F138
Auto approve: 1