Intel

AIKIDO-2026-10622

lru is vulnerable to Use After Free

Use After Free Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Apr 28, 2026

62

Medium Risk

This Affects:

RUSTlru
0.12.4 - 0.17.0
Fixed in 0.18.0
Are you affected? Scan for Free

TL;DR

The LruCache::get_or_insert_mut_ref API had an unconstrained lifetime relationship where the returned &'a mut V was not tied to the borrow lifetime of self. This lets callers hold a mutable reference that can outlive safe access guarantees of the cache internals, creating memory-unsound behavior in safe Rust. In affected versions this can lead to use-after-free style undefined behavior when references are used after cache state changes. The fix changes the method receiver to &'a mut self, correctly binding the returned reference lifetime to the cache borrow.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

lru is vulnerable to Use After Free in versions 0.12.4 - 0.17.0.

How to fix this

Upgrade the lru library to the patch version.