Intel

AIKIDO-2026-202465

thread_local is vulnerable to Integer Underflow

Integer Underflow Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Yesterday

32

Low Risk

This Affects:

RUSTthread_local
0.1.0 - 1.1.9
Fixed in 1.1.10
Are you affected? Scan for Free

TL;DR

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.

Who does this affect?

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.

Background info

thread_local is vulnerable to Integer Underflow in versions 0.1.0 - 1.1.9.

How to fix this

Upgrade the thread_local library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform