Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🦀 crates.io
Not in CISA KEV

GHSA-rjhf-4mh8-9xjq zerocopy

GHSA-rjhf-4mh8-9xjq is a security vulnerability in zerocopy. A fix is available for zerocopy — see the affected versions and patch details below.

Zerocopy: Some Ref methods are unsound with some type parameters

Also known asGHSA-3mv5-343c-w2qgRUSTSEC-2023-0074
Published
Dec 18, 2023
Updated
Feb 12, 2024
Affected
6 pkgs
Patched
6 / 6
Exploits
None indexed
Exploitation data as of Feb 12, 2024 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

6 pkgs affected
🦀zerocopy🦀zerocopy🦀zerocopy🦀zerocopy🦀zerocopy🦀zerocopy

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.

Description

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.

Affected Packages

6 total 6 fixed
EcosystemPackageVulnerable rangeFix
🦀crates.iozerocopy0.2.2&&< 0.2.90.2.9cargo update -p zerocopy --precise 0.2.9
🦀crates.iozerocopy0.3.0&&< 0.3.20.3.2cargo update -p zerocopy --precise 0.3.2
🦀crates.iozerocopy0.4.0&&< 0.4.10.4.1cargo update -p zerocopy --precise 0.4.1
🦀crates.iozerocopy0.5.0&&< 0.5.20.5.2cargo update -p zerocopy --precise 0.5.2
🦀crates.iozerocopy0.6.0&&< 0.6.60.6.6cargo update -p zerocopy --precise 0.6.6
🦀crates.iozerocopy0.7.0&&< 0.7.310.7.31cargo update -p zerocopy --precise 0.7.31

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for zerocopy, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update zerocopy to 0.2.9 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-rjhf-4mh8-9xjq is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-rjhf-4mh8-9xjq can be triaged on real exposure rather than presence alone.

Tailored to GHSA-rjhf-4mh8-9xjq. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

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`](https://doc.rust-lang.org/core/cell/struct.Ref.html) or [`cell::RefMut`](https://doc.rust-lang.org/core/cell/struct.RefMut.html). 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/z
O3 Security · Impact-Aware SCA

Is GHSA-rjhf-4mh8-9xjq in your dependencies?

O3 Security finds GHSA-rjhf-4mh8-9xjq across crates.io dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-rjhf-4mh8-9xjq: zerocopy | O3 Security