{"id":"CVE-2021-28032","aliases":["EUVD-2021-1918","GHSA-wp34-mqw5-jj85","RUSTSEC-2021-0031"],"status":"published","title":"Use after free in nano_arena","description":"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\u003cIdx\u003e behaves in certain ways. This can have a resultant out-of-bounds write or use-after-free.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-11","score":0.01528,"percentile":0.7504,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-416"],"published":"2021-01-31T12:00:00Z","modified":"2026-06-17T03:45:45Z","fixes":[{"ecosystem":"crates.io","package":"nano_arena","fixed_in":["0.5.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"nano_arena","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.5.2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"nano_arena","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.5.2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"nano_arena","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.5.2"}]}]}],"products":[{"vendor":"nano_arena_project","product":"nano_arena"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0031.html","tags":["x_refsource_MISC","x_transferred","Exploit","Patch","Third Party Advisory","web","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-28032","tags":["advisory"]},{"url":"https://github.com/bennetthardwick/nano-arena/issues/1","tags":["web","report"]},{"url":"https://github.com/bennetthardwick/nano-arena/commit/6b83f9d0708337a9f8b709c1624a8587021ceba2","tags":["web"]},{"url":"https://github.com/advisories/GHSA-wp34-mqw5-jj85"},{"url":"https://github.com/bennetthardwick/nano-arena","tags":["package"]},{"url":"https://crates.io/crates/nano_arena","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-28032","description":"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\u003cIdx\u003e behaves in certain ways. This can have a resultant out-of-bounds write or use-after-free.","status":"published","published":"2021-03-05T08:40:02Z","modified":"2024-08-03T21:33:17.226Z","updated_at":"2026-11-02T14:33:08.811269Z"}],"euvd":[{"id":"EUVD-2021-1918","description":"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\u003cIdx\u003e behaves in certain ways. This can have a resultant out-of-bounds write or use-after-free.","status":"published","published":"2021-03-05T08:40:02Z","modified":"2024-08-03T21:33:17Z","updated_at":"2026-11-03T03:24:47.350261Z"}],"ghsa":[{"id":"GHSA-wp34-mqw5-jj85","title":"Use after free in nano_arena","description":"Affected versions of this crate assumed that Borrow\u003cIdx\u003e 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\u003cIdx\u003e 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.","status":"published","published":"2021-08-25T20:52:00Z","modified":"2023-06-13T20:02:47Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T14:36:53.654352Z"}],"nvd":[{"id":"CVE-2021-28032","description":"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\u003cIdx\u003e behaves in certain ways. This can have a resultant out-of-bounds write or use-after-free.","status":"published","published":"2021-03-05T09:15:14.097Z","modified":"2026-06-17T03:45:45.043Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"updated_at":"2026-11-02T14:06:50.399901Z"}],"osv":[{"id":"GHSA-wp34-mqw5-jj85","title":"Use after free in nano_arena","description":"Affected versions of this crate assumed that Borrow\u003cIdx\u003e 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\u003cIdx\u003e 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.","status":"published","published":"2021-08-25T20:52:00Z","modified":"2023-11-08T04:05:27.788398Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T15:46:58.767335Z"},{"id":"RUSTSEC-2021-0031","title":"split_at allows obtaining multiple mutable references to the same data","description":"Affected versions of this crate assumed that `Borrow\u003cIdx\u003e` 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\u003cIdx\u003e` 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.","status":"published","published":"2021-01-31T12:00:00Z","modified":"2023-11-08T04:05:27.788398Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:53:39.492624Z"}]}}
