SEVERITY NOT PROVIDED

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

Published 2026-11-18 · Updated 2026-11-19

Summary

A flaw in heapless can cause IndexMap::insert to break a map invariant when a map is filled to u16::MAX elements and the final inserted item hashes to u16::MAX. Developers using affected versions of heapless should upgrade to the patched release.

Who is affected

The affected deployment scope is crates.io heapless from version 0.0.0-0 through versions preceding 0.9.4. Exploitation requires the map to contain u16::MAX elements and the last inserted item to hash to u16::MAX. The report notes this is very unlikely to be reachable in a real-world scenario.

Exploitability

The CVSS vector and base score are not documented. EPSS is not yet available. CISA KEV is not YES, so active exploitation should not be claimed.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
crates.io heapless >= 0.0.0-0, < 0.9.4 0.9.4 cargo update -p heapless --precise 0.9.4

FAQ

What is the flaw?

IndexMap::insert in heapless may break a map invariant when the map holds u16::MAX elements and the last inserted element hashes to u16::MAX.

Which versions are affected?

heapless versions introduced at 0.0.0-0 are affected; version 0.9.4 is the fixed release.

Is this vulnerability known to be actively exploited?

No. CISA KEV is not YES, and the record does not document active exploitation.

Original advisory 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

Source records: RUSTSEC-2026-0582 (OSV.dev).