{"id":"CVE-2021-45709","aliases":["EUVD-2022-0545","GHSA-9hfg-pxr6-q4vp","GHSA-pmcv-mgcf-rvxg","RUSTSEC-2021-0121"],"status":"published","title":"Use of a Broken or Risky Cryptographic Algorithm in crypto2","description":"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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-09","score":0.00778,"percentile":0.56141,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-119"],"published":"2021-10-08T12:00:00Z","modified":"2026-06-17T04:13:59Z","affected":[{"source":"ghsa","ecosystem":"crates.io","package":"crypto2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.1.2"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"crypto2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.1.2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"crypto2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.1.2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"crypto2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.1.2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"crypto2","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"}]}]}],"products":[{"vendor":"crypto2_project","product":"crypto2"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0121.html","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web","advisory"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/crypto2/RUSTSEC-2021-0121.md","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45709","tags":["advisory"]},{"url":"https://github.com/shadowsocks/crypto2/issues/27","tags":["web","report"]},{"url":"https://github.com/advisories/GHSA-9hfg-pxr6-q4vp"},{"url":"https://github.com/advisories/GHSA-pmcv-mgcf-rvxg"},{"url":"https://github.com/shadowsocks/crypto2","tags":["package"]},{"url":"https://crates.io/crates/crypto2","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-45709","description":"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.","status":"published","published":"2021-12-26T21:47:32Z","modified":"2024-08-04T04:47:02.019Z","updated_at":"2026-11-02T14:33:02.930115Z"}],"euvd":[{"id":"EUVD-2022-0545","description":"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.","status":"published","published":"2021-12-26T21:47:32Z","modified":"2024-08-04T04:47:02Z","updated_at":"2026-11-03T03:08:25.77408Z"}],"ghsa":[{"id":"GHSA-9hfg-pxr6-q4vp","title":"Use of a Broken or Risky Cryptographic Algorithm in crypto2","description":"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.","status":"published","published":"2022-01-06T22:04:51Z","modified":"2023-08-17T05:02:22Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-119"],"updated_at":"2026-11-02T14:37:00.074932Z"},{"id":"GHSA-pmcv-mgcf-rvxg","title":"Non-aligned u32 read in Chacha20 encryption and decryption","description":"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.\n","status":"published","published":"2022-06-16T23:51:32Z","modified":"2023-06-13T17:32:10Z","updated_at":"2026-11-02T14:36:53.654352Z"}],"nvd":[{"id":"CVE-2021-45709","description":"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.","status":"published","published":"2021-12-27T00:15:10.017Z","modified":"2026-06-17T04:13:59.617Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","level":"high","assessor":"primary"}],"cwes":["CWE-119"],"updated_at":"2026-11-02T14:07:02.977492Z"}],"osv":[{"id":"GHSA-9hfg-pxr6-q4vp","title":"Use of a Broken or Risky Cryptographic Algorithm in crypto2","description":"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.","status":"published","published":"2022-01-06T22:04:51Z","modified":"2023-11-08T04:07:23.178602Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-119"],"updated_at":"2026-11-02T15:46:43.875515Z"},{"id":"GHSA-pmcv-mgcf-rvxg","title":"Non-aligned u32 read in Chacha20 encryption and decryption","description":"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.\n","status":"published","published":"2022-06-16T23:51:32Z","modified":"2023-11-08T04:07:23.178602Z","updated_at":"2026-11-02T15:46:53.244788Z"},{"id":"RUSTSEC-2021-0121","title":"Non-aligned u32 read in Chacha20 encryption and decryption","description":"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.","status":"published","published":"2021-10-08T12:00:00Z","modified":"2023-11-08T04:07:23.178602Z","updated_at":"2026-11-02T15:53:39.492624Z"}]}}
