// For flags

CVE-2018-5382

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

Severity Score

4.4
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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.

El almacén de claves BKS por defecto utiliza un HMAC de sólo 16 bits, lo que puede permitir a un atacante comprometer la integridad de un almacén de claves BKS. La versión 1.47 de Bouncy Castle cambia el formato BKS a un formato que utiliza un HMAC de 160 bits. Esto se aplica a cualquier almacén de claves BKS generado antes de BC 1.47. Para las situaciones en las que la gente necesita crear los archivos por razones de legado, se introdujo un tipo de almacén de claves específico "BKS-V1" en la versión 1.49. Hay que tener en cuenta que los autores de la biblioteca desaconsejan el uso de "BKS-V1" y que sólo debe utilizarse cuando sea seguro hacerlo, como cuando el uso de una suma de comprobación de 16 bits para la comprobación de la integridad del archivo no vaya a causar un problema de seguridad en sí mismo

A flaw involving a risky cryptographic algorithm was found in Bouncycastle. BKS-V1 contained a design flaw resulting from using the SHA-1 hash function, as it contains a 16-bit MAC key size and a 160-bit SHA-1 hash function. This flaw allows an attacker to brute force the password due to the trivial hash collisions, resulting in a loss of confidentiality and integrity.

*Credits: N/A
CVSS Scores
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None
Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None
Attack Vector
Local
Attack Complexity
Low
Authentication
None
Confidentiality
Partial
Integrity
Partial
Availability
None
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2018-01-12 CVE Reserved
  • 2018-04-16 CVE Published
  • 2023-04-10 EPSS Updated
  • 2024-09-16 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
  • CWE-327: Use of a Broken or Risky Cryptographic Algorithm
  • CWE-354: Improper Validation of Integrity Check Value
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Bouncycastle
Search vendor "Bouncycastle"
Legion-of-the-bouncy-castle-java-crytography-api
Search vendor "Bouncycastle" for product "Legion-of-the-bouncy-castle-java-crytography-api"
<= 1.49
Search vendor "Bouncycastle" for product "Legion-of-the-bouncy-castle-java-crytography-api" and version " <= 1.49"
-
Affected
Redhat
Search vendor "Redhat"
Satellite
Search vendor "Redhat" for product "Satellite"
6.4
Search vendor "Redhat" for product "Satellite" and version "6.4"
-
Affected
Redhat
Search vendor "Redhat"
Satellite Capsule
Search vendor "Redhat" for product "Satellite Capsule"
6.4
Search vendor "Redhat" for product "Satellite Capsule" and version "6.4"
-
Affected