RUSTSEC-2026-0576: `IndexMap::truncate` could lead to an inconsistent state
Published 2026-11-18 · Updated 2026-11-19
Summary
The `IndexMap::truncate` method in the heapless crate fails to rebuild internal indices, causing an inconsistent state and memory corruption. Developers using heapless versions prior to 0.9.4 should upgrade immediately.
Who is affected
All projects depending on the heapless crate at versions 0.0.0 through 0.9.3 are affected. The vulnerability manifests when the `IndexMap::truncate` method is called, leaving the internal index structure in an inconsistent state that can lead to memory corruption. No additional conditions beyond calling this method are required for the flaw to trigger.
Exploitability
No CVSS vector or base score is provided, so exploitability cannot be quantified. EPSS data is not yet available for this vulnerability. CISA Known Exploited Vulnerabilities catalog does not list this issue, indicating no confirmed active exploitation.
Remediation
- Upgrade the heapless crate to version 0.9.4 or later in all Cargo.toml manifests.
- Run `cargo audit` or `cargo deny` to verify no transitive dependencies pull in an affected heapless version.
How to check your project
- Inspect Cargo.lock for heapless version entries earlier than 0.9.4.
- Execute `cargo tree -p heapless` to identify all dependency paths pulling in the vulnerable crate.
Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| crates.io | heapless |
>= 0.0.0-0, < 0.9.4 | 0.9.4 | cargo update -p heapless --precise 0.9.4 |
FAQ
Which crate and versions are affected?
The heapless crate on crates.io, versions 0.0.0 through 0.9.3 inclusive.
What is the root cause of the vulnerability?
`IndexMap::truncate` does not rebuild its internal indices when truncating, leaving the map in an inconsistent state that can cause memory corruption.
Is there a workaround if upgrading is not immediately possible?
Not documented; the only supported remediation is upgrading to heapless 0.9.4 or later.
Original advisory description
References
- PACKAGE https://crates.io/crates/heapless
- ADVISORY https://rustsec.org/advisories/RUSTSEC-2026-0576.html
- REPORT https://github.com/rust-embedded/heapless/issues/674
Source records: RUSTSEC-2026-0576 (OSV.dev).