Skip to content

CVE-2018-5382 Bouncy Castle BKS-V1 keystore files vulnerable to trivial hash collisions

MediumCVSS 4.4 EPSS 0.26%
Published
Updated
Exploit status
No public exploit known
Technology
UbuntuDebianRed Hat

Description

The default BKS keystore use an HMAC that is only 16 bits long, which can allow an attacker to compromise the integrity of a BKS keystore. Bouncy Castle release 1.47 changes the BKS format to a format which uses a 160 bit HMAC instead. This applies to any BKS keystore generated prior to BC 1.47. For situations where people need to create the files for legacy reasons a specific keystore type "BKS-V1" was introduced in 1.49. It should be noted that the use of "BKS-V1" is discouraged by the library authors and should only be used where it is otherwise safe to do so, as in where the use of a 16 bit checksum for the file integrity check is not going to cause a security issue in itself.

Upgrade path

10 packages: 8 fixed.

PackageAffectedFixed inStatus
bouncycastle bc-java <= 1.49 after 1.49 Fixed
debian/bouncycastle(Debian 12) < 1.48+dfsg-2 1.48+dfsg-2 Fixed
debian/bouncycastle(Debian 13) < 1.48+dfsg-2 1.48+dfsg-2 Fixed
debian/bouncycastle(Debian 14) < 1.48+dfsg-2 1.48+dfsg-2 Fixed
Legion of the Bouncy Castle Inc. Bouncy Castle < 1.47 1.47 Fixed
org.bouncycastle/bcprov-jdk15on(Maven) < 1.50; = 1.46; = 1.47; = 1.48 +1 more 1.50 Fixed
ubuntu/bouncycastle(Ubuntu 14.04) < 1.49+dfsg-2; = 1.48+dfsg-2 1.49+dfsg-2 Fixed
ubuntu/bouncycastle(Ubuntu 16.04) < 1.51-4ubuntu1; = 1.49+dfsg-3ubuntu1 1.51-4ubuntu1 Fixed
redhat satellite = 6.4 No fix listed Versions listed
redhat satellite capsule = 6.4 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
org.bouncycastle/bcprov-jdk15on(Maven) < 1.50 1.50
debian/bouncycastle(Debian:12) < 1.48+dfsg-2 1.48+dfsg-2
debian/bouncycastle(Debian:14) < 1.48+dfsg-2 1.48+dfsg-2
debian/bouncycastle(Debian:13) < 1.48+dfsg-2 1.48+dfsg-2
org.bouncycastle/bcprov-jdk15on(Maven) = 1.46 No fix listed
org.bouncycastle/bcprov-jdk15on(Maven) = 1.47 No fix listed
org.bouncycastle/bcprov-jdk15on(Maven) = 1.48 No fix listed
org.bouncycastle/bcprov-jdk15on(Maven) = 1.49 No fix listed
bouncycastle bc-java <= 1.49 No fix listed
redhat satellite = 6.4 No fix listed
redhat satellite capsule = 6.4 No fix listed
Legion of the Bouncy Castle Inc. Bouncy Castle < 1.47 1.47
ubuntu/bouncycastle(Ubuntu:14.04) < 1.49+dfsg-2 1.49+dfsg-2
ubuntu/bouncycastle(Ubuntu:14.04) = 1.48+dfsg-2 No fix listed
ubuntu/bouncycastle(Ubuntu:16.04) < 1.51-4ubuntu1 1.51-4ubuntu1
ubuntu/bouncycastle(Ubuntu:16.04) = 1.49+dfsg-3ubuntu1 No fix listed

References