The analysis of the provided commits reveals several vulnerabilities across the libcrux-ecdh, libcrux-psq, and libcrux-ed25519 crates. The root causes of these vulnerabilities are improper input validation and error handling.
-
Improper Input Validation:
- In
libcrux-ecdh, the validate_scalar function failed to check for proper clamping of X25519 scalars, only checking for all-zero scalars. This allowed the use of weak keys.
- In
libcrux-psq, the DHPrivateKey::from_bytes function contained a logically incorrect clamping check, permitting the import of invalid Diffie-Hellman private keys.
-
Error Handling and Panics:
- In
libcrux-psq, the AEADKeyNonce::open function would panic upon a decryption failure due to an .unwrap() call. This could be exploited for a denial-of-service attack by providing a malformed ciphertext.
-
Cryptographic Bug Fix:
- In
libcrux-ed25519, a duplicated key clamping step was removed from the generate_key_pair function. While presented as a bug fix, it highlights issues in the cryptographic implementation that are part of the overall security advisory.
The identified vulnerable functions are those that directly contained these flaws. During runtime, exploitation of these vulnerabilities would involve these functions processing malicious or malformed inputs, leading to the use of weak keys or service-terminating panics.