RUSTSEC-2021-0121

Source
https://rustsec.org/advisories/RUSTSEC-2021-0121
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0121.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2021-0121
Aliases
Published
2021-10-08T12:00:00Z
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
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / crypto2

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [
            "crypto2::streamcipher::Chacha20::decrypt_slice",
            "crypto2::streamcipher::Chacha20::encrypt_slice",
            "crypto2::streamcipher::xor_si512_inplace"
        ],
        "arch": []
    }
}

Database specific

{
    "cvss": null,
    "informational": "unsound",
    "categories": []
}