mirror of
https://github.com/OMGeeky/advisory-db.git
synced 2026-01-05 19:20:34 +01:00
Unsound implementation of Chacha20 in crypto2 (#1072)
This commit is contained in:
22
crates/crypto2/RUSTSEC-0000-0000.md
Normal file
22
crates/crypto2/RUSTSEC-0000-0000.md
Normal file
@@ -0,0 +1,22 @@
|
||||
```toml
|
||||
[advisory]
|
||||
id = "RUSTSEC-0000-0000"
|
||||
package = "crypto2"
|
||||
date = "2021-10-08"
|
||||
url = "https://github.com/shadowsocks/crypto2/issues/27"
|
||||
informational = "unsound"
|
||||
keywords = ["crypto", "alignment", "unsound"]
|
||||
|
||||
[affected.functions]
|
||||
"crypto2::streamcipher::Chacha20::encrypt_slice" = ["*"]
|
||||
"crypto2::streamcipher::Chacha20::decrypt_slice" = ["*"]
|
||||
"crypto2::streamcipher::xor_si512_inplace" = ["*"]
|
||||
|
||||
[versions]
|
||||
patched = []
|
||||
```
|
||||
|
||||
# Non-aligned u32 read in Chacha20 encryption and decryption
|
||||
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.
|
||||
Reference in New Issue
Block a user