Memory Corruption Affecting thread_local package, versions <1.1.4


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Memory Corruption vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUST-THREADLOCAL-2359987
  • published25 Jan 2022
  • disclosed23 Jan 2022
  • creditUnknown

Introduced: 23 Jan 2022

CVE NOT AVAILABLE CWE-119  (opens in a new tab)

How to fix?

Upgrade thread_local to version 1.1.4 or higher.

Overview

thread_local is a library which allow a separate copy of an object to be used for each thread. This allows for per-object thread-local storage, unlike the standard library's thread_local! macro which only allows static thread-local storage.

Affected versions of this package are vulnerable to Memory Corruption via {Iter, IterMut}::next which uses a weaker memory ordering when loading values than what was required, exposing a potential data race when iterating over ThreadLocal's values.

CVSS Base Scores

version 3.1