GitHub Advisoryadvisory · crates.io

GHSA-m8h8-v6jh-c762 Incorrect buffer size in crossbeam-channel

MEDIUM Published 2021-08-25 Modified 2023-06-13 Official page ↗
Aliases
CVE-2020-35904
Ecosystem
crates.io
Packages
crossbeam-channel
Severity
Moderate
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weaknesses
CWE-131
Reviewed
2021-08-19

Affected packages

• crates.io crossbeam-channel: >= 0.4.3, < 0.4.4 → fixed in 0.4.4

Description

The affected version of this crate's 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.

Related

Alias · CVE (1)

  • CVE-2020-35904 An issue was discovered in the crossbeam-channel crate before 0.4.4 for Rust. vulnerability

Weakness · CWE (1)

  • CWE-131 Incorrect Calculation of Buffer Size weakness

References