
Cloud Vulnerability DB
A community-led vulnerabilities database
The crossbeam-channel crate before version 0.4.4 for Rust contained a vulnerability identified as RUSTSEC-2020-0052 (CVE-2020-35904). The issue was discovered in June 2020 and involved incorrect expectations about the relationship between memory allocation and iterator elements count. This vulnerability affected the ArrayQueue implementation in the crossbeam-channel crate (Github PR).
The vulnerability stemmed from the bounded channel incorrectly assuming that Vec::from_iter allocated capacity exactly matching the number of iterator elements. However, Vec::from_iter does not guarantee this and may allocate extra memory. The destructor of the bounded channel reconstructed Vec from the raw pointer based on these incorrect assumptions, leading to unsound behavior and causing deallocation with incorrect capacity when Vec::from_iter allocated different sizes than the number of iterator elements (Github PR). The issue received a CVSS v3.1 Base Score of 5.5 (Medium) with vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H (NVD).
The vulnerability could lead to undefined behavior when deallocating memory, potentially causing memory corruption of allocator structures. In one reported case, it resulted in corruption of jemalloc structures and ultimately caused deadlocks (Github PR).
The vulnerability required local access and could be triggered through normal usage of the affected ArrayQueue implementation. The issue was particularly concerning as it affected a core synchronization primitive used in many Rust applications (NVD).
The vulnerability was fixed in crossbeam-channel version 0.4.4 by using Box<[T]> instead of Vec<T> for initialization and dropping of ArrayQueue, which guarantees exact capacity allocation. Users were recommended to upgrade to version 0.4.4 or later. The previous vulnerable version 0.4.3 was yanked from crates.io (Github PR).
The vulnerability garnered significant attention in the Rust community, with several major projects like Mozilla's Gecko engine and Servo browser engine updating their dependencies to address the issue. The discovery led to discussions about improving the release process for critical security fixes, as there was a two-month gap between the bug's discovery and the release of the fix (Github PR).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."