GHSA-xpww-g9jx-hp8r: Sha2 Miscomputed Sha2 Results When Using Vulnerability
HIGHGHSA-xpww-g9jx-hp8r is a HIGH miscomputed sha2 results when using vulnerability (General Security Weakness) affecting Sha2 libraries in the crates.io ecosystem. The issue involves miscomputed sha2 results when using avx2 backend. Remediation is available by upgrading affected packages to version 0.9.8.
GHSA-xpww-g9jx-hp8r at a Glance
How to Fix GHSA-xpww-g9jx-hp8r
To remediate this vulnerability, upgrade all affected Sha2 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 sha2 to 0.9.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for sha2
How to Check if You Are Affected
To determine whether your application is affected by GHSA-xpww-g9jx-hp8r, inspect your project dependencies for Sha2:
inspect dependencies for sha2
Analyze the terminal output to locate any version of Sha2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.8), 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 Sha2, 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-xpww-g9jx-hp8r Affected Sha2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sha2
|
crates.io |
≥ 0.9.7
< 0.9.8
All 1 versions
0.9.7
|
0.9.8
|
References
Frequently Asked Questions
What is GHSA-xpww-g9jx-hp8r?
Which Sha2 versions are affected?
What version fixes GHSA-xpww-g9jx-hp8r?
Is sha2 affected?
What CWE is associated with GHSA-xpww-g9jx-hp8r?
How can I check crates.io dependencies for GHSA-xpww-g9jx-hp8r?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xpww-g9jx-hp8r",
"modified" : "2022-06-17T00:19:35Z",
"published" : "2022-06-17T00:19:35Z",
"aliases" : [ ],
"summary" : "Miscomputed sha2 results when using AVX2 backend",
"details" : "The v0.9.7 release of the `sha2` crate introduced a new AVX2-accelerated\nbackend which was automatically enabled for all x86/x86_64 CPUs where AVX2\nsupport was autodetected at runtime.\n\nThis backend was buggy and would miscompute results for long messages\n(i.e. messages spanning multiple SHA blocks).\n\nThe crate has since been yanked, but any users who upgraded to v0.9.7 should\nimmediately upgrade to v0.9.8 and recompute any hashes which were previously\ncomputed by v0.9.7.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "sha2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.9.7"
}, {
"fixed" : "0.9.8"
} ]
} ],
"versions" : [ "0.9.7" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/RustCrypto/hashes/pull/314"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/RustCrypto/hashes"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2021-0100.html"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T00:19:35Z",
"nvd_published_at" : null
}
}