# RUSTSEC-2026-0581: Deque::make\_contiguous could lead to broken invariants

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

## Affected versions

- heapless (crates.io): fixed in 0.9.4

## Description

In some branches, `Deque::make_contiguous` set the `back` value to either `0` or `N` when it shouldn't, leading to broken invariants and out-of-bounds writes.

Reported by [DRMacIver](https://github.com/DRMacIver) and [https://github.com/MJUCOM](https://github.com/MJUCOM).

## References

- https://crates.io/crates/heapless
- https://rustsec.org/advisories/RUSTSEC-2026-0581.html
- https://github.com/rust-embedded/heapless/issues/694
- https://github.com/rust-embedded/heapless/issues/676

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

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