GHSA-rjhf-4mh8-9xjq: Zerocopy Some Ref Methods Are Unsound Vulnerability
MODERATEGHSA-rjhf-4mh8-9xjq is a MODERATE some ref methods are unsound vulnerability (General Security Weakness) affecting Zerocopy libraries in the crates.io ecosystem. The issue involves some ref methods are unsound with some type parameters. Remediation is available by upgrading affected packages to version 0.2.9, 0.3.2, 0.4.1, 0.5.2, 0.6.6, 0.7.31.
GHSA-rjhf-4mh8-9xjq at a Glance
How to Fix GHSA-rjhf-4mh8-9xjq
To remediate this vulnerability, upgrade all affected Zerocopy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade zerocopy to 0.2.9
Upgrade zerocopy to 0.3.2
Upgrade zerocopy to 0.4.1
Upgrade zerocopy to 0.5.2
Upgrade zerocopy to 0.6.6
Upgrade zerocopy to 0.7.31
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for zerocopy
How to Check if You Are Affected
To determine whether your application is affected by GHSA-rjhf-4mh8-9xjq, inspect your project dependencies for Zerocopy:
inspect dependencies for zerocopy
Analyze the terminal output to locate any version of Zerocopy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.9), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under General Security Weakness. In Zerocopy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-rjhf-4mh8-9xjq Affected Zerocopy Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
zerocopy
|
crates.io |
≥ 0.2.2
< 0.2.9
|
0.2.9
|
|
zerocopy
|
crates.io |
≥ 0.3.0
< 0.3.2
|
0.3.2
|
|
zerocopy
|
crates.io |
≥ 0.4.0
< 0.4.1
|
0.4.1
|
|
zerocopy
|
crates.io |
≥ 0.5.0
< 0.5.2
|
0.5.2
|
|
zerocopy
|
crates.io |
≥ 0.6.0
< 0.6.6
|
0.6.6
|
|
zerocopy
|
crates.io |
≥ 0.7.0
< 0.7.31
|
0.7.31
|
References
Frequently Asked Questions
What is GHSA-rjhf-4mh8-9xjq?
Which Zerocopy versions are affected?
What version fixes GHSA-rjhf-4mh8-9xjq?
Is zerocopy affected?
What CWE is associated with GHSA-rjhf-4mh8-9xjq?
How can I check crates.io dependencies for GHSA-rjhf-4mh8-9xjq?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rjhf-4mh8-9xjq",
"modified" : "2024-02-12T15:57:50Z",
"published" : "2023-12-18T19:18:46Z",
"aliases" : [ ],
"summary" : "Zerocopy: Some Ref methods are unsound with some type parameters",
"details" : "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`.\n\nSee https://github.com/google/zerocopy/issues/716 for a more in-depth analysis.\n\nThe current plan is to yank the affected versions soon. See https://github.com/google/zerocopy/issues/679 for more detail.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "zerocopy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.2.2"
}, {
"fixed" : "0.2.9"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "zerocopy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.3.0"
}, {
"fixed" : "0.3.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "zerocopy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.4.0"
}, {
"fixed" : "0.4.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "zerocopy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.5.0"
}, {
"fixed" : "0.5.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "zerocopy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.6.0"
}, {
"fixed" : "0.6.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "zerocopy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.7.0"
}, {
"fixed" : "0.7.31"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/google/zerocopy/issues/679"
}, {
"type" : "WEB",
"url" : "https://github.com/google/zerocopy/issues/71"
}, {
"type" : "WEB",
"url" : "https://github.com/google/zerocopy/issues/716"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/google/zerocopy"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2023-0074.html"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-12-18T19:18:46Z",
"nvd_published_at" : null
}
}