Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. crypto2
  4. ›
  5. CVE-2021-45709

CVE-2021-45709: Use of a Broken or Risky Cryptographic Algorithm in crypto2

January 6, 2022 (updated June 13, 2023)

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.

This affects Chacha20 encryption and decryption in crypto2.

References

  • github.com/advisories/GHSA-9hfg-pxr6-q4vp
  • github.com/shadowsocks/crypto2
  • github.com/shadowsocks/crypto2/issues/27
  • nvd.nist.gov/vuln/detail/CVE-2021-45709
  • raw.githubusercontent.com/rustsec/advisory-db/main/crates/crypto2/RUSTSEC-2021-0121.md
  • rustsec.org/advisories/RUSTSEC-2021-0121.html

Code Behaviors & Features

Detect and mitigate CVE-2021-45709 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions up to 0.1.2

Solution

Unfortunately, there is no solution available yet.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer

Source file

cargo/crypto2/CVE-2021-45709.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:25 +0000.