GHSA-9hfg-pxr6-q4vp

Suggest an improvement
Source
https://github.com/advisories/GHSA-9hfg-pxr6-q4vp
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/01/GHSA-9hfg-pxr6-q4vp/GHSA-9hfg-pxr6-q4vp.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-9hfg-pxr6-q4vp
Aliases
Published
2022-01-06T22:04:51Z
Modified
2023-11-08T04:07:23.178602Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Use of a Broken or Risky Cryptographic Algorithm in crypto2
Details

The implementation does not enforce alignment requirements on input slices while incorrectly assuming 4-byte alignment through an unsafe call to std::slice::fromrawparts_mut, which breaks the contract and introduces undefined behavior.

This affects Chacha20 encryption and decryption in crypto2.

Database specific
{
    "nvd_published_at": "2021-12-27T00:15:00Z",
    "cwe_ids": [
        "CWE-119"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2022-01-05T22:55:41Z"
}
References

Affected packages

crates.io / crypto2

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
0.1.2

Ecosystem specific

{
    "affected_functions": [
        "crypto2::streamcipher::Chacha20::decrypt_slice",
        "crypto2::streamcipher::Chacha20::encrypt_slice",
        "crypto2::streamcipher::xor_si512_inplace"
    ]
}