{"id":"CVE-2021-45696","aliases":["CVE-2021-45696","GHSA-fc7x-2cmc-8j2g","GHSA-xpww-g9jx-hp8r","RUSTSEC-2021-0100"],"related":[],"kind":"vulnerability","state":"published","title":"Incorrect hash in sha2","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.\n\nThis backend was buggy and would miscompute results for long messages (i.e. messages spanning multiple SHA blocks).\n\nThe 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se ha detectado un problema en la crate sha2 versiones 0.9.7 anteriores a 0.9.8 para Rust. Los hash de los mensajes largos pueden ser incorrectos cuando es usado el backend acelerado AVX2","source":"nvd"}],"published":"2021-09-08T12:00:00.000Z","modified":"2026-06-17T04:13:57.980Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"rating","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-327"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.9.7","status":"affected","fixed":"0.9.8"}],"ecosystem":"crates.io","package":"sha2","purl":"pkg:cargo/sha2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.9.7","status":"affected","fixed":"0.9.8"}],"ecosystem":"crates.io","package":"sha2","purl":"pkg:cargo/sha2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.9.7","status":"affected","fixed":"0.9.8"}],"ecosystem":"crates.io","package":"sha2","purl":"pkg:cargo/sha2","source":"rustsec"},{"ranges":[{"status":"affected","version":"0.9.7"}],"vendor":"sha2_project","product":"sha2","cpe":"cpe:2.3:a:sha2_project:sha2:0.9.7:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0100.html","tags":["advisory","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/sha2/RUSTSEC-2021-0100.md","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45696","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/RustCrypto/hashes/pull/314","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/RustCrypto/hashes","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/sha2","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-45696","url":"https://www.cve.org/CVERecord?id=CVE-2021-45696","licence":"CVE Terms of Use","modified":"2024-08-04T04:47:01.970Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fc7x-2cmc-8j2g","url":"https://github.com/advisories/GHSA-fc7x-2cmc-8j2g","licence":"CC-BY-4.0","modified":"2023-11-08T04:07:22.441Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xpww-g9jx-hp8r","url":"https://github.com/advisories/GHSA-xpww-g9jx-hp8r","licence":"CC-BY-4.0","modified":"2023-11-08T04:07:22.441Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0100","url":"https://rustsec.org/advisories/RUSTSEC-2021-0100.html","licence":"CC0-1.0","modified":"2023-11-08T04:07:22.441Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-45696","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45696","licence":"Public domain","modified":"2026-06-17T04:13:57.980Z"}],"updatedAt":"2026-11-25T22:58:06.266Z","epss":{"score":0.00831,"percentile":0.587,"date":"2026-12-01T12:00:22.000Z"}}