Vulnerability LowRUSTSEC-2023-0074 · zerocopy
RUSTSEC-2023-0074: Some Ref methods are unsound with some type parameters
Short answerA security vulnerability in the zerocopy crate: Some Ref methods are unsound with some type parameters. GitHub rates it Low. Fixed in 0.2.9, 0.3.2, 0.4.1, 0.5.2, 0.6.6, 0.7.31: update to a fixed version.
| Crate | zerocopy |
|---|---|
| Type | Vulnerability |
| Affected versions | From 0.2.2 before 0.2.9; from 0.3.0 before 0.3.2; from 0.4.0 before 0.4.1; from 0.5.0 before 0.5.2; from 0.6.0 before 0.6.6; from 0.7.0 before 0.7.31. |
| Fixed in | 0.2.9, 0.3.2, 0.4.1, 0.5.2, 0.6.6, 0.7.31 |
| Severity | Low (GitHub rating) |
| Published | 2023-12-14 |
| Last changed | 2024-02-10 |
| Also known as | GHSA-3mv5-343c-w2qg, GHSA-rjhf-4mh8-9xjq |
| Affected functions | zerocopy::Ref::into_mut, zerocopy::Ref::into_mut_slice, zerocopy::Ref::into_ref, zerocopy::Ref::into_slice |
What to do
- See which version you have:
cargo tree -i zerocopy(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p zerocopy. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplezerocopy = "0.7.31") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
The Ref methods into_ref, into_mut, into_slice, and into_slice_mut are unsound and may allow safe code to exhibit undefined behavior when used with Ref<B, T> where B is cell::Ref or cell::RefMut. Note that these methods remain sound when used with B types other than cell::Ref or cell::RefMut.
See https://github.com/google/zerocopy/issues/716 for a more in-depth analysis.
The current plan is to yank the affected versions soon. See https://github.com/google/zerocopy/issues/679 for more detail.
References
- Package: crates.io/crates/zerocopy
- Advisory: rustsec.org/advisories/RUSTSEC-2023-0074.html
- Report: github.com/google/zerocopy/issues/716
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Same cratezerocopy: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?