Advisory

GHSA-xpww-g9jx-hp8r

Also known as: CVE-2021-45696, GHSA-fc7x-2cmc-8j2g, RUSTSEC-2021-0100

Summary

Miscomputed sha2 results when using AVX2 backend

Details

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2022-06-17 00:19 UTC
Modified
2023-11-08 04:07 UTC

Affected packages and fixes

sha2

crates.io · All systems

Affected

  • introduced 0.9.7, fixed 0.9.8 (semver)

Fixed versions

0.9.8

Fix

  • Fixed version 0.9.8
    cargo update -p sha2 --precise 0.9.8

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences