Unsound LowRUSTSEC-2026-0002 · lru
RUSTSEC-2026-0002: `IterMut` violates Stacked Borrows by invalidating internal pointer
Short answerlru has an API that can cause undefined behaviour from safe code: `IterMut` violates Stacked Borrows by invalidating internal pointer. Fixed in 0.16.3.
| Crate | lru |
|---|---|
| Type | Unsound (memory-corruption) |
| Affected versions | From 0.9.0 before 0.16.3. |
| Fixed in | 0.16.3 |
| Severity | Low (GitHub rating) |
| Published | 2026-01-07 |
| Last changed | 2026-01-08 |
| Also known as | GHSA-rhfx-m35p-ff5j |
What to do
- See which version you have:
cargo tree -i lru(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p lru. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplelru = "0.16.3") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Affected versions of this crate contain a soundness issue in the IterMut iterator implementation. The IterMut::next and IterMut::next_back methods temporarily create an exclusive reference to the key when dereferencing the internal node pointer.
This invalidates the shared pointer held by the internal HashMap, violating Stacked Borrows rules.
References
- Package: crates.io/crates/lru
- Advisory: rustsec.org/advisories/RUSTSEC-2026-0002.html
- Web: github.com/jeromefroe/lru-rs/pull/224
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for lru
Up next
Same cratelru: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?