8.1high
Undefined Behavior in bounded Crossbeam channel
- Severity
- 8.1high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 2.70% (higher than 86% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-m8h8-v6jh-c762GHSA-v5m7-53cv-f3hxRUSTSEC-2020-0052
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| crossbeam-rs crossbeam | < 0.4.4 | CVE List |
| crossbeam-channel (crates.io) | from 0.4.3 before 0.4.4 | GitHub Advisory Database, RustSec Advisory Database |
| crossbeam_project crossbeam | before 0.4.4 | NVD |
All scores
| GitHub_M | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
GitHub Advisory Database
Impact
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.
Patches
This has been fixed in crossbeam-channel 0.4.4.
We recommend users to upgrade to 0.4.4.
References
See https://github.com/crossbeam-rs/crossbeam/pull/533, https://github.com/crossbeam-rs/crossbeam/issues/539, and https://github.com/RustSec/advisory-db/pull/425 for more details.
License
This advisory is in the public domain.
RustSec Advisory Database
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.
NVD (es)
Crossbeam es un conjunto de herramientas para programación concurrente. En crossbeam-channel versiones anteriores a 0.4.4, el canal acotado asume inapropiadamente que "Vec::from_iter" ha asignado una capacidad igual a la cantidad de elementos iteradores. "Vec::from_iter" en realidad no garantiza eso y puede asignar memoria extra. El destructor del canal "bounded" reconstruye "Vec" a partir del puntero sin procesar basándose en los supuestos incorrectos descritos anteriormente. Esto no es correcto y causa una desasignación con la capacidad incorrecta cuando "VVec::from_iter" ha asignado diferentes tamaños con el número de elementos del iterador. Esto ha sido corregido en crossbeam-channel versión 0.4.4
References
| https://github.com/crossbeam-rs/crossbeam/security/advisories/GHSA-v5m7-53cv-f3hx | third-party-advisory, web | |
| https://github.com/crossbeam-rs/crossbeam/issues/539 | exploit, third-party-advisory, web | |
| https://github.com/crossbeam-rs/crossbeam/pull/533 | exploit, patch, third-party-advisory, web | |
| https://github.com/RustSec/advisory-db/pull/425 | patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2020-35904 | advisory | |
| https://github.com/crossbeam-rs/crossbeam | package | |
| https://rustsec.org/advisories/RUSTSEC-2020-0052.html | advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2020-15254 | advisory | |
| https://crates.io/crates/crossbeam-channel | package | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-15254 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-m8h8-v6jh-c762 changed 2023-11-08 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-v5m7-53cv-f3hx changed 2026-07-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2020-0052 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2020-15254 changed 2026-06-17 | Public domain |