Rust advisories / thread_local
Vulnerability HighRUSTSEC-2022-0006 · thread_local
RUSTSEC-2022-0006: Data race in `Iter` and `IterMut`
Short answerA security vulnerability in the thread_local crate: Data race in `Iter` and `IterMut`. GitHub rates it High. Fixed in 1.1.4: update to a fixed version.
| Crate | thread_local |
|---|---|
| Type | Vulnerability (memory-corruption) |
| Affected versions | Before 1.1.4. |
| Fixed in | 1.1.4 |
| Severity | High (GitHub rating) |
| Published | 2022-01-23 |
| Last changed | 2023-11-08 |
| Also known as | GHSA-9hpw-r23r-xgm5 |
What to do
- See which version you have:
cargo tree -i thread_local(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p thread_local. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplethread_local = "1.1.4") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
In the affected version of this crate, {Iter, IterMut}::next used a weaker memory ordering when loading values than what was required, exposing a potential data race when iterating over a ThreadLocal's values.
Crates using Iter::next, or IterMut::next are affected by this issue.
References
- Package: crates.io/crates/thread_local
- Advisory: rustsec.org/advisories/RUSTSEC-2022-0006.html
- Report: github.com/Amanieu/thread_local-rs/issues/33
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?