VYPR
High severityNVD Advisory· Published Oct 16, 2020· Updated Aug 4, 2024

Undefined Behavior in bounded Crossbeam channel

CVE-2020-15254

Description

Crossbeam is a set of tools for concurrent programming. In crossbeam-channel before version 0.4.4, the bounded channel incorrectly assumes that Vec::from_iter has allocated capacity that same as the number of iterator elements. Vec::from_iter does not actually guarantee that and may allocate extra memory. The destructor of the bounded channel reconstructs Vec from the raw pointer based on the incorrect assumes described above. This is unsound and causing deallocation with the incorrect capacity when Vec::from_iter has allocated different sizes with the number of iterator elements. This has been fixed in crossbeam-channel 0.4.4.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Crossbeam-channel before 0.4.4 has unsound deallocation due to wrong capacity assumption in bounded channel destructor, potentially leading to memory corruption.

Root

Cause

The vulnerability resides in the bounded channel implementation of crossbeam-channel prior to version 0.4.4. The code incorrectly assumed that Vec::from_iter allocates exactly the number of elements as capacity. In reality, Vec::from_iter may allocate extra memory. The bounded channel's destructor reconstructs a Vec from a raw pointer based on this false assumption, leading to deallocation with an incorrect capacity [1][3].

Exploitation

This is a memory safety issue that manifests during destruction of the bounded channel. An attacker would need to be able to trigger the drop of a bounded channel whose internal buffer was allocated with a size different from the expected capacity. No special network position or authentication is required if the vulnerable code path is exercised in a user-controlled application [1][2].

Impact

When Vec::from_iter allocates extra capacity, the destructor frees a mismatched memory region, which is undefined behavior. This unsoundness can lead to memory corruption, potentially exploitable for arbitrary code execution or information disclosure. Real-world impact may include deadlocks in allocators such as jemalloc, as reported in downstream projects [2].

Mitigation

The issue has been fixed in crossbeam-channel version 0.4.4 by using Box<[T]> instead of Vec for the buffer, guaranteeing exact capacity [2][3]. All users should upgrade to 0.4.4 or later.

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
crossbeam-channelcrates.io
>= 0.4.3, < 0.4.40.4.4

Affected products

4

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

7

News mentions

0

No linked articles in our index yet.