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
Real-World Exposure
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.9cargo update -p zerocopy --precise 0.2.9 |
| 🦀crates.io | zerocopy | ≥ 0.3.0&&< 0.3.2 | 0.3.2cargo update -p zerocopy --precise 0.3.2 |
| 🦀crates.io | zerocopy | ≥ 0.4.0&&< 0.4.1 | 0.4.1cargo update -p zerocopy --precise 0.4.1 |
| 🦀crates.io | zerocopy | ≥ 0.5.0&&< 0.5.2 | 0.5.2cargo update -p zerocopy --precise 0.5.2 |
| 🦀crates.io | zerocopy | ≥ 0.6.0&&< 0.6.6 | 0.6.6cargo update -p zerocopy --precise 0.6.6 |
| 🦀crates.io | zerocopy | ≥ 0.7.0&&< 0.7.31 | 0.7.31cargo update -p zerocopy --precise 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, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
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 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
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.