# RUSTSEC-2026-0582: On maps of u16::MAX elements, IndexMap::insert could lead to a broken invariant

- Database: RustSec
- Published: 2026-11-18
- Modified: 2026-11-19

## Affected versions

- heapless (crates.io): fixed in 0.9.4

## Description

Note that this required filling up the map and having the last item inserted to hash to `u16::MAX`. It is therefore very unlikely to be reachable in a real-world scenario.

Reported by [8rsrf7](https://github.com/8rsrf7).

## References

- https://crates.io/crates/heapless
- https://rustsec.org/advisories/RUSTSEC-2026-0582.html
- https://github.com/rust-embedded/heapless/issues/672

Page: https://cve.now/RUSTSEC-2026-0582

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
