Fedora Account System
Red Hat Associate
Red Hat Customer
A flaw was found in sequoia-openpgp. S2K::derive_key runs Argon2id with the t, p, and m parameters from the sender. The only local check is that 2^m fits in a u32, which still allows m=31, requesting 2 TiB of Argon2 memory, and it does not cap t or p. Since 2.0.0, Blocks::new allocates that memory with alloc_zeroed and returns an error if the allocation fails, so the process is not aborted. Parameters that still allocate successfully are not limited. The Policy trait in 2.4.2 has no s2k method, and derive_key does not consult StandardPolicy. A sender can therefore impose a large CPU and memory cost on a recipient who decrypts a password-protected message or unlocks a password-protected secret key. Argon2 S2K support dates from the 2.0.0.alpha.0 line and is present in 2.4.2. This is not the separate Argon2 scratch-memory leak tracked as GitLab issue 1211.