lru is vulnerable to Use After Free
62
Medium Risk
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.
You are affected if you are using a version that falls within the vulnerable range.
lru is vulnerable to Use After Free in versions 0.12.4 - 0.17.0.
Upgrade the lru library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

SOC 2Compliant
ISO 27001Compliant