{"id":"RUSTSEC-2026-0128","summary":"Double-free and use-after-free in `Keys::next()`","details":"`Keys::next()` uses `ptr::read` to move out the `Option\u003cV\u003e` by value, which\ndrops the contained `V` when `V` is non-Copy (e.g. `String`). This leaves a\ndangling value in the map's storage slot. Subsequent `get()` operations on\nthat key return a dangling reference to already-freed memory.\n\nThis can be triggered through safe public APIs — `Map::keys()`,\n`Keys::next()`, and `Map::get()` — with no `unsafe` required from the\ncaller. Under Miri, accessing the freed slot produces \"Undefined Behavior:\npointer not dereferenceable: alloc has been freed, so this pointer is\ndangling\".","modified":"2026-05-13T12:30:06.615206Z","published":"2026-05-02T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/emap"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0128.html"},{"type":"REPORT","url":"https://github.com/yegor256/emap/issues/168"}],"affected":[{"package":{"name":"emap","ecosystem":"crates.io","purl":"pkg:cargo/emap"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"}]}],"ecosystem_specific":{"affects":{"arch":[],"os":[],"functions":[]},"affected_functions":null},"database_specific":{"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0128.json","informational":"unsound","categories":["memory-corruption"],"cvss":null}}],"schema_version":"1.7.5"}