Both nRF51 and nRF52 devices are affected by the experimental software-only implementations that show the LE Secure Connections pairing procedure in nRF5 SDK.
- nRF5 SDK versions prior to v15.0.0
-
Elliptic curve public keys were not validated for examples with Bluetooth® LE Secure Connections in nRF5 SDK versions prior to v15.0.0.
Experimental APIs for cryptographic routines are provided in nRF5 SDK versions prior to v15.0.0. There are also examples showing Bluetooth LE Secure Connections using these experimental cryptographic APIs.
Implementations in nRF5 SDK versions prior to v15.0.0 use µECC to perform ECDH/DHKey generation in Bluetooth LE Secure Connections paring procedures. The implementations do not validate the remote Elliptic Curve Public Key as part of the pairing procedure, making it susceptible to the attacks described in Vulnerability Note VU#304725.
The following are possible solutions to mitigate security issues for using µECC in SDK versions prior to nRF5 SDK v15.0.0:- Migrate to nRF5 SDK v15.0.0 and use the nrf_crypto APIs and the ble_lesc module according to the SDK examples containing Bluetooth LE Secure Connections pairing procedures.
- Add a specific call to the API to validate the elliptic curve public key received from the remote during the pairing procedure before using it to calculate the ECDH/DHKey. This API is called uECC_valid_public_key. Abort the pairing procedure if an invalid public key is detected by sending a random generated DHKey.
- nRF5 SDK v15.0.0
-
Elliptic curve public keys are properly validated for the APIs used in Bluetooth LE Secure Connections pairing procedures if the nrf_crypto APIs and the ble_lesc module are used.
Implementations in nRF5 SDK v15.0.0 using ble_lesc and nrf_crypto are not susceptible to the vulnerability described in Vulnerability Note VU#304725.
Calling µECC_valid_public_key will perform a Partial validation of Elliptic Curve Public Key operation according to the SEC1 standard (see Chapter 3.2.3, Partial Validation of Elliptic Curve Public Key, in SEC 1: Elliptic Curve Cryptography v2.0). This partial validation is a proper test to ensure that the attack is not possible. Adding this validation to examples from SDKs prior to v15.0.0 will remove the vulnerability. It is also required to abort the pairing procedure if the validation fails. There are no APIs in the SoftDevice to signal a detected invalid public key. It is recommended to respond with an invalid DHkey generated in the form of random numbers in case an invalid public key is detected.