{"id":"CVE-2021-45709","aliases":["CVE-2021-45709","GHSA-9hfg-pxr6-q4vp","GHSA-pmcv-mgcf-rvxg","RUSTSEC-2021-0121"],"related":[],"kind":"vulnerability","state":"published","title":"Use of a Broken or Risky Cryptographic Algorithm in crypto2","summary":"An issue was discovered in the crypto2 crate through 2021-10-08 for Rust. During Chacha20 encryption and decryption, an unaligned read of a u32 may occur.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the crypto2 crate through 2021-10-08 for Rust. During Chacha20 encryption and decryption, an unaligned read of a u32 may occur.","source":"cvelist"},{"lang":"en","text":"The implementation does not enforce alignment requirements on input slices while incorrectly assuming 4-byte alignment through an unsafe call to std::slice::from_raw_parts_mut, which breaks the contract and introduces undefined behavior.\n\nThis affects Chacha20 encryption and decryption in crypto2.","format":"markdown","source":"ghsa"},{"lang":"en","text":"The implementation does not enforce alignment requirements on input slices while incorrectly assuming 4-byte alignment through an unsafe call to `std::slice::from_raw_parts_mut`, which breaks the contract and introduces undefined behavior.\n\nThis affects Chacha20 encryption and decryption in crypto2.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se ha detectado un problema en la crate crypto2 versiones hasta 08-10-2021 para Rust. Durante el cifrado y descifrado de Chacha20, puede producirse una lectura no alineada de un u32","source":"nvd"}],"published":"2021-10-08T12:00:00.000Z","modified":"2026-06-17T04:13:59.617Z","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-119"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.1.2"}],"ecosystem":"crates.io","package":"crypto2","purl":"pkg:cargo/crypto2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.1.2"}],"ecosystem":"crates.io","package":"crypto2","purl":"pkg:cargo/crypto2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected"}],"ecosystem":"crates.io","package":"crypto2","purl":"pkg:cargo/crypto2","source":"rustsec"},{"ranges":[],"vendor":"crypto2_project","product":"crypto2","cpe":"cpe:2.3:a:crypto2_project:crypto2:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0121.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/crypto2/RUSTSEC-2021-0121.md","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45709","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/shadowsocks/crypto2/issues/27","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/shadowsocks/crypto2","tags":["package"],"sources":["ghsa"]},{"url":"https://crates.io/crates/crypto2","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-45709","url":"https://www.cve.org/CVERecord?id=CVE-2021-45709","licence":"CVE Terms of Use","modified":"2024-08-04T04:47:02.019Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9hfg-pxr6-q4vp","url":"https://github.com/advisories/GHSA-9hfg-pxr6-q4vp","licence":"CC-BY-4.0","modified":"2023-11-08T04:07:23.178Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pmcv-mgcf-rvxg","url":"https://github.com/advisories/GHSA-pmcv-mgcf-rvxg","licence":"CC-BY-4.0","modified":"2023-11-08T04:07:23.178Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0121","url":"https://rustsec.org/advisories/RUSTSEC-2021-0121.html","licence":"CC0-1.0","modified":"2023-11-08T04:07:23.178Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-45709","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45709","licence":"Public domain","modified":"2026-06-17T04:13:59.617Z"}],"updatedAt":"2026-11-25T22:58:06.271Z","epss":{"score":0.00778,"percentile":0.57066,"date":"2026-12-01T12:00:22.000Z"}}