{"id":"CVE-2021-28032","aliases":["CVE-2021-28032","GHSA-wp34-mqw5-jj85","RUSTSEC-2021-0031"],"related":[],"kind":"vulnerability","state":"published","title":"Use after free in nano_arena","summary":"An issue was discovered in the nano_arena crate before 0.5.2 for Rust. There is an aliasing violation in split_at because two mutable references can exist for the same element, if Borrow<Idx> behaves in certain ways. This can have a resultant out-of-bounds write or use-after-free.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the nano_arena crate before 0.5.2 for Rust. There is an aliasing violation in split_at because two mutable references can exist for the same element, if Borrow<Idx> behaves in certain ways. This can have a resultant out-of-bounds write or use-after-free.","source":"cvelist"},{"lang":"en","text":"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.\n\nIf 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.\n\nThe flaw was corrected in commit `6b83f9d` by storing the .borrow() value in a temporary variable.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Affected versions of this crate assumed that `Borrow<Idx>` was guaranteed to\nreturn the same value on `.borrow()`. The borrowed index value was used to\nretrieve a mutable reference to a value.\n\nIf the `Borrow<Idx>` implementation returned a different index, the split arena\nwould allow retrieving the index as a mutable reference creating two mutable\nreferences to the same element. This violates Rust's aliasing rules and allows\nfor memory safety issues such as writing out of bounds and use-after-frees.\n\nThe flaw was corrected in commit `6b83f9d` by storing the `.borrow()` value in\na temporary variable.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se detectó un problema en la crate nano_arena versiones anteriores a 0.5.2 para Rust.&#xa0;Se presenta una violación de alias en split_at porque pueden presentar dos referencias mutables para el mismo elemento, si Borrow(Idx) se comporta de determinadas maneras.&#xa0;Esto puede tener como resultado una escritura fuera de límites o un uso de la memoria previamente liberada","source":"nvd"}],"published":"2021-01-31T12:00:00.000Z","modified":"2026-06-17T03:45:45.043Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.5.2"}],"ecosystem":"crates.io","package":"nano_arena","purl":"pkg:cargo/nano_arena","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.5.2"}],"ecosystem":"crates.io","package":"nano_arena","purl":"pkg:cargo/nano_arena","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.5.2"}],"vendor":"nano_arena_project","product":"nano_arena","cpe":"cpe:2.3:a:nano_arena_project:nano_arena:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0031.html","tags":["advisory","exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28032","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/bennetthardwick/nano-arena/issues/1","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/bennetthardwick/nano-arena/commit/6b83f9d0708337a9f8b709c1624a8587021ceba2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/bennetthardwick/nano-arena","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/nano_arena","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-28032","url":"https://www.cve.org/CVERecord?id=CVE-2021-28032","licence":"CVE Terms of Use","modified":"2024-08-03T21:33:17.226Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wp34-mqw5-jj85","url":"https://github.com/advisories/GHSA-wp34-mqw5-jj85","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:27.788Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0031","url":"https://rustsec.org/advisories/RUSTSEC-2021-0031.html","licence":"CC0-1.0","modified":"2023-11-08T04:05:27.788Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-28032","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28032","licence":"Public domain","modified":"2026-06-17T03:45:45.043Z"}],"updatedAt":"2026-11-25T22:58:00.154Z","epss":{"score":0.01546,"percentile":0.75743,"date":"2026-12-01T12:00:22.000Z"}}