thread_local is vulnerable to Out-of-Bounds Read
57
Medium Risk
ThreadLocal::get_or and get_or_try call an internal insert routine that unconditionally writes the new value into the thread's slot and increments an internal entry counter, even when the create closure has already reentrantly initialized that same slot on the same thread. The extra increment desynchronizes the counter from the number of populated slots, so RawIter::next_mut keeps scanning past the last valid entry and indexes the bucket array out of bounds, and the overwritten slot leaves any reference already returned to the reentrant call dangling. The fix checks whether the slot is already initialized before writing and returns the existing value instead of overwriting it.
You are affected if you are using a version that falls within the vulnerable range and you call get_or or get_or_try with a closure that reentrantly calls back into the same ThreadLocal on the same thread.
thread_local is vulnerable to Out-of-Bounds Read in versions 0.1.0 - 1.1.9.
Upgrade the thread_local 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.

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.