CVE-2021-45696
Incorrect hash in sha2
An issue was discovered in the sha2 crate 0.9.7 before 0.9.8 for Rust. Hashes of long messages may be incorrect when the AVX2-accelerated backend is used.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used 9.8
An issue was discovered in the sha2 crate 0.9.7 before 0.9.8 for Rust. Hashes of long messages may be incorrect when the AVX2-accelerated backend is used.
- Record
CVE-2021-45696- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-327
- Updated
- 2026-11-02
CVE ListNo score
An issue was discovered in the sha2 crate 0.9.7 before 0.9.8 for Rust. Hashes of long messages may be incorrect when the AVX2-accelerated backend is used.
- Record
CVE-2021-45696- Updated
- 2026-11-02
EUVDEUVD-2022-0580No score
An issue was discovered in the sha2 crate 0.9.7 before 0.9.8 for Rust. Hashes of long messages may be incorrect when the AVX2-accelerated backend is used.
- Record
EUVD-2022-0580- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-fc7x-2cmc-8j2g 9.8
Incorrect hash in sha2
The v0.9.7 release of the sha2 crate introduced a new AVX2-accelerated backend which was automatically enabled for all x86/x86_64 CPUs where AVX2 support was autodetected at runtime.
This backend was buggy and would miscompute results for long messages (i.e. messages spanning multiple SHA blocks).
The crate has since been yanked, but any users who upgraded to v0.9.7 should immediately upgrade to v0.9.8 and recompute any hashes which were previously computed by v0.9.7.
- Record
GHSA-fc7x-2cmc-8j2g- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-327
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-xpww-g9jx-hp8rNo score
Miscomputed sha2 results when using AVX2 backend
The v0.9.7 release of the sha2 crate introduced a new AVX2-accelerated
backend which was automatically enabled for all x86/x86_64 CPUs where AVX2
support was autodetected at runtime.
This backend was buggy and would miscompute results for long messages (i.e. messages spanning multiple SHA blocks).
The crate has since been yanked, but any users who upgraded to v0.9.7 should immediately upgrade to v0.9.8 and recompute any hashes which were previously computed by v0.9.7.
- Record
GHSA-xpww-g9jx-hp8r- Updated
- 2026-11-02
OSVGHSA-fc7x-2cmc-8j2g 9.8
Incorrect hash in sha2
The v0.9.7 release of the sha2 crate introduced a new AVX2-accelerated backend which was automatically enabled for all x86/x86_64 CPUs where AVX2 support was autodetected at runtime.
This backend was buggy and would miscompute results for long messages (i.e. messages spanning multiple SHA blocks).
The crate has since been yanked, but any users who upgraded to v0.9.7 should immediately upgrade to v0.9.8 and recompute any hashes which were previously computed by v0.9.7.
- Record
GHSA-fc7x-2cmc-8j2g- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-327
- Updated
- 2026-11-02
OSVGHSA-xpww-g9jx-hp8rNo score
Miscomputed sha2 results when using AVX2 backend
The v0.9.7 release of the sha2 crate introduced a new AVX2-accelerated
backend which was automatically enabled for all x86/x86_64 CPUs where AVX2
support was autodetected at runtime.
This backend was buggy and would miscompute results for long messages (i.e. messages spanning multiple SHA blocks).
The crate has since been yanked, but any users who upgraded to v0.9.7 should immediately upgrade to v0.9.8 and recompute any hashes which were previously computed by v0.9.7.
- Record
GHSA-xpww-g9jx-hp8r- Updated
- 2026-11-02
OSVRUSTSEC-2021-0100No score
Miscomputed results when using AVX2 backend
The v0.9.7 release of the sha2 crate introduced a new AVX2-accelerated
backend which was automatically enabled for all x86/x86_64 CPUs where AVX2
support was autodetected at runtime.
This backend was buggy and would miscompute results for long messages (i.e. messages spanning multiple SHA blocks).
The crate has since been yanked, but any users who upgraded to v0.9.7 should immediately upgrade to v0.9.8 and recompute any hashes which were previously computed by v0.9.7.
- Record
RUSTSEC-2021-0100- Updated
- 2026-11-02
Affected products
Affected packages
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-45696 is a critical vulnerability (CVSS 9.8) in Sha2 Project Sha2, published September 8, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.83%, the 58th percentile. Fixed in sha2 0.9.8.
References
rustsec.org/advisories/RUSTSEC-2021-0100.html
raw.githubusercontent.com/rustsec/advisory-db/main/crates/sha2/RUSTSEC-2021-0100.md
nvd.nist.gov/vuln/detail/CVE-2021-45696
github.com/RustCrypto/hashes/pull/314
github.com/advisories/GHSA-fc7x-2cmc-8j2g
github.com/advisories/GHSA-xpww-g9jx-hp8r
github.com/RustCrypto/hashes
crates.io/crates/sha2