GHSA-rjhf-4mh8-9xjq
Zerocopy: Some Ref methods are unsound with some type parameters
Blast Radius
zerocopy🦀zerocopy🦀zerocopy🦀zerocopy🦀zerocopy🦀zerocopyReal-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
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | zerocopy | ≥ 0.2.2&&< 0.2.9 | 0.2.9 |
| 🦀crates.io | zerocopy | ≥ 0.3.0&&< 0.3.2 | 0.3.2 |
| 🦀crates.io | zerocopy | ≥ 0.4.0&&< 0.4.1 | 0.4.1 |
| 🦀crates.io | zerocopy | ≥ 0.5.0&&< 0.5.2 | 0.5.2 |
| 🦀crates.io | zerocopy | ≥ 0.6.0&&< 0.6.6 | 0.6.6 |
| 🦀crates.io | zerocopy | ≥ 0.7.0&&< 0.7.31 | 0.7.31 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for zerocopy. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
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.
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.
How O3 protects you
O3 pinpoints whether GHSA-rjhf-4mh8-9xjq is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
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
Is GHSA-rjhf-4mh8-9xjq in your dependencies?
O3 detects GHSA-rjhf-4mh8-9xjq across crates.io dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.