thread_local is vulnerable to Integer Underflow
32
Low Risk
RawIter::size_hint loads the ThreadLocal entry counter and subtracts the number of already yielded entries with no bounds check, while Entry.present is set to true before that counter is incremented. A thread iterating with ThreadLocal::iter while another thread is still inserting a new entry can observe more yielded entries than the counter reflects, so the subtraction underflows and wraps to a huge usize. Passing that value into Vec::from_iter/collect triggers a capacity overflow panic, crashing the iterating thread. The fix saturates the subtraction so the count can no longer underflow.
You are affected if you are using a version that falls within the vulnerable range and you call ThreadLocal::iter or collect its results while other threads may still be inserting new values.
thread_local is vulnerable to Integer Underflow 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.