# RUSTSEC-2026-0128: Double-free and use-after-free in `Keys::next()`

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-05-02T12:00:00.000Z
- Modified: 2026-05-13T12:30:06.615Z

## Description

`Keys::next()` uses `ptr::read` to move out the `Option<V>` by value, which
drops the contained `V` when `V` is non-Copy (e.g. `String`). This leaves a
dangling value in the map's storage slot. Subsequent `get()` operations on
that key return a dangling reference to already-freed memory.

This can be triggered through safe public APIs — `Map::keys()`,
`Keys::next()`, and `Map::get()` — with no `unsafe` required from the
caller. Under Miri, accessing the freed slot produces "Undefined Behavior:
pointer not dereferenceable: alloc has been freed, so this pointer is
dangling".

(As written by RustSec Advisory Database.)

## Affected

- emap (crates.io): from 0.0.0-0

## References

- <https://crates.io/crates/emap> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0128.html> (advisory)
- <https://github.com/yegor256/emap/issues/168> (report)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0128](https://rustsec.org/advisories/RUSTSEC-2026-0128.html), CC0-1.0, modified 2026-05-13

---

Page: https://cve.day/RUSTSEC-2026-0128 · Whole record: https://cve.day/RUSTSEC-2026-0128.json · Rebuilt by cve.day 2026-11-25T22:56:43.349Z
