lru is vulnerable to Use-After-Free
59
CVE Score
Medium
Use-After-Free
The pop method on LruCache frees a cache node's heap allocation and runs the stored key's destructor before detaching the node from the internal doubly linked list. When a key type has a Drop implementation that panics, unwinding skips the detach step, so the neighboring list nodes keep raw pointers into the freed allocation. Later cache operations then dereference those dangling pointers, producing a use-after-free that is reachable from safe Rust. The fix detaches the node from the list before dropping the key so the list stays consistent even if the destructor panics.
Upgrade the lru library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you store keys whose Drop implementation can panic and keep using the cache after catching the unwind.
0.6.4 - 0.18.1
Fixed in 0.18.2lru is vulnerable to Use-After-Free in versions 0.6.4 - 0.18.1.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.