Heapless: On maps of `u16::MAX` elements, `IndexMap::insert` could lead to a broken invariant
Affects heaplessSource GCVE Database
Rated Low by Threat Radar's AI analysis
- Patch
- Available – fixed in 0.9.4
Data as of 19 Nov 2026, 09:49 UTC
What to do
Upgrade heapless to 0.9.4.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
crates.ioheaplesspkg:cargo/heaplessOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade to heapless version 0.9.4 or later, where this issue has been fixed. Since a patch is available and the vulnerability is addressed in the fixed version, applying this update is the recommended remediation.
Description
A vulnerability in the Rust crate 'heapless' affects the IndexMap data structure when it contains u16::MAX elements. Inserting the last item that hashes to u16::MAX can break an internal invariant. This scenario requires the map to be completely filled and the last inserted element to hash to a specific value, making it very unlikely in real-world use. The issue is fixed in version 0.9.4.