CVE-2020-36204: Data races in im crate for Rust

im Updated 02 Oct 2025

Summary

09/11/2020
Yes i
Moderate
4.7

CVE-2020-36204: TreeFocus lacks bounds on its Send and Sync traits. Affects im versions >= 12.0.0, < 15.1.0. Fixed in 15.1.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The im crate is a library for Rust that provides immutable data structures. It is commonly used for efficient manipulation of collections and trees. The crate offers various data structures such as vectors, hash maps, and trees. These data structures are designed to be immutable, meaning they cannot be modified once created. However, a vulnerability has been discovered in the im crate that can lead to data races.

Vulnerability Detail

The vulnerability in the im crate is due to the lack of bounds on the Send trait or Sync trait for the TreeFocus struct. This means that multiple threads can access and modify the TreeFocus struct simultaneously, leading to data races. Data races occur when two or more threads access shared data concurrently, and at least one of the threads modifies the data. This can result in unpredictable behavior and incorrect program execution. In the case of the im crate, a data race can lead to incorrect manipulation of the tree structure and potentially cause crashes or other unexpected outcomes.

How To Fix

Latest published version: 15.1.0 as of 23 Oct 2026

The newest release already contains this fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the im crate is not feasible or immediate, a possible workaround is to avoid concurrent access to the TreeFocus struct. This can be achieved by synchronizing access to the struct using synchronization primitives such as locks or mutexes. By ensuring that only one thread can access the struct at a time, data races can be prevented. Here is an example of using a mutex to synchronize access to the TreeFocus struct:

use std::sync::Mutex;

fn main() {
    let tree_focus = Mutex::new(TreeFocus::new());
    // Access and modify the tree_focus struct within a synchronized block
    {
        let mut guard = tree_focus.lock().unwrap();
        // Perform operations on the tree_focus struct
    }
}

Conclusion

The im crate for Rust has been found to have a vulnerability that can lead to data races. To mitigate this vulnerability, it is recommended to update the crate to version 15.1.0 or later. If immediate update is not possible, using synchronization primitives like locks or mutexes can provide a temporary workaround. For further assistance and support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for im →

Share this vulnerability

FAQ

The im crate is a library for Rust that provides immutable data structures. It is commonly used for efficient manipulation of collections and trees.

A data race occurs when two or more threads access shared data concurrently, and at least one of the threads modifies the data. This can lead to unpredictable behavior and incorrect program execution.

The data races in the im crate can result in incorrect manipulation of the tree structure and potentially cause crashes or other unexpected outcomes.

To fix the vulnerability, it is recommended to update the im crate to version 15.1.0 or later. This version includes the necessary bounds on the Send trait and Sync trait for the TreeFocus struct, preventing data races from occurring.

If updating the im crate is not feasible or immediate, a possible workaround is to avoid concurrent access to the TreeFocus struct by synchronizing access using locks or mutexes.

Related vulnerabilities

Recent vulnerabilities recorded for im.

How To Fix

Latest published version: 15.1.0 as of 23 Oct 2026

The newest release already contains this fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback