Undefined Behavior in bounded Crossbeam channel
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.
| Package | Affected versions | Patched versions |
|---|---|---|
crossbeam-channelcrates.io | >= 0.4.3, < 0.4.4 | 0.4.4 |
Affected products
4- ghsa-coords3 versionspkg:cargo/crossbeam-channelpkg:rpm/opensuse/firefox-esr&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/MozillaFirefox&distro=openSUSE%20Tumbleweed
>= 0.4.3, < 0.4.4+ 2 more
- (no CPE)range: >= 0.4.3, < 0.4.4
- (no CPE)range: < 128.5.1-1.1
- (no CPE)range: < 92.0-1.2
- crossbeam-rs/crossbeamv5Range: < 0.4.4
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
7- github.com/advisories/GHSA-v5m7-53cv-f3hxghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-15254ghsaADVISORY
- github.com/RustSec/advisory-db/pull/425ghsax_refsource_MISCWEB
- github.com/crossbeam-rs/crossbeam/issues/539ghsax_refsource_MISCWEB
- github.com/crossbeam-rs/crossbeam/pull/533ghsax_refsource_MISCWEB
- github.com/crossbeam-rs/crossbeam/security/advisories/GHSA-v5m7-53cv-f3hxghsax_refsource_CONFIRMWEB
- rustsec.org/advisories/RUSTSEC-2020-0052.htmlghsaWEB
News mentions
0No linked articles in our index yet.