GHSA-pmcv-mgcf-rvxg

Suggest an improvement
Source
https://github.com/advisories/GHSA-pmcv-mgcf-rvxg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/06/GHSA-pmcv-mgcf-rvxg/GHSA-pmcv-mgcf-rvxg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-pmcv-mgcf-rvxg
Aliases
Published
2022-06-16T23:51:32Z
Modified
2023-11-08T04:07:23.178602Z
Summary
Non-aligned u32 read in Chacha20 encryption and decryption
Details

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.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2022-06-16T23:51:32Z"
}
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"
    ]
}