Bugzilla – Bug 1088257
VUL-1: CVE-2018-5382: bouncycastle: BKS-V1 keystore files vulnerable to trivial hash collisions
Last modified: 2019-05-29 08:36:24 UTC
Affected versions of the package are vulnerable to Hash Collision due to an error in the BKS version 1 keystore files.
BKS is a keystore format, designed to function similarly to a Sun/Oracle JKS keystore. BKS files can contain public keys, private keys and certificates, and they rely on a password-based encryption to provide confidentiality and integrity protections to the keystore contents.
The first version of a BKS file (aka BKS-V1) contained a design flaw when determining the key size used to protect the keystore data. It used the SHA-1 hash function, which is 160 bits in length. In a RFC7292-compliant cryptographic algorithm, the MAC key size should be the same size as the hash function being used, meaning that the MAC key size should be 160 bits long for BKS files.
However, Bouncy Castle BKS-V1 files uses only 16 bits for the MAC key size. Regardless of the complexity of the password, ghe BKS-V1 file will have merely 65,536 different encryption keys. An attacker may bruteforce this password in a matter of seconds by testing all 65K values.
We are shipping 1.54 (Leap 42.3) and 1.58 (Factory), so not affected by this.