Email me

Rust advisories / lru

Vulnerability HighRUSTSEC-2021-0130 · lru

RUSTSEC-2021-0130: Use after free in lru crate

Short answerA security vulnerability in the lru crate: Use after free in lru crate. GitHub rates it High. Fixed in 0.7.1: update to a fixed version.

Cratelru
TypeVulnerability (memory-corruption)
Affected versionsBefore 0.7.1.
Fixed in0.7.1
SeverityHigh (GitHub rating)
Published2021-12-21
Last changed2023-11-08
Also known asCVE-2021-45720, GHSA-qqmc-hwqp-8g2w, GHSA-v362-2895-h9r2
Affected functionslru::LruCache::iter, lru::LruCache::iter_mut

What to do

  1. See which version you have: cargo tree -i lru (it also shows which of your dependencies pulls it in).
  2. 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 example lru = "0.7.1") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

Lru crate has use after free vulnerability.

Lru crate has two functions for getting an iterator. Both iterators give references to key and value. Calling specific functions, like pop(), will remove and free the value, and but it's still possible to access the reference of value which is already dropped causing use after free.

References

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

Full security history of 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?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ