Applus+ Laboratories found out that OP-TEE is vulnerable to a timing attack when doing the Montgomery operations.
One way to optimize modular exponentiation is to make use of something called Montgomery multiplication and Montgomery reduction. OP-TEE implements the Montgomery operations in the big number library, libmpa. The current implementation uses a binary Left to Right (LtoR) implementation. The LtoR implementation is vulnerable to timing attacks since it leaks information about the exponent in use, because it uses different amount of time in each loop when doing the exponentiation. The leaked information can be used to completely recover the private key. One mitigation to this attack is to change the implementation to a constant time exponentiation algorithm instead of LtoR. One such algorithm is the so called Montgomery powering ladder, which does the same amount of operations in every loop. I.e., it will always do square and multiply in every loop. The fix (Montgomery ladder) for the timing attack has been implemented in:
Patches
optee_os.git
- libmpa: Implement Montgomery ladder (40b1b28)
Workarounds
N/A
References
OP-TEE ID
OP-TEE-2016-0003
Reported by
Applus+ Laboratories
For more information
For more information regarding the security incident process in OP-TEE, please read the information that can be found when going to the "Security" page at https://www.trustedfirmware.org.
Applus+ Laboratories found out that OP-TEE is vulnerable to a timing attack when doing the Montgomery operations.
One way to optimize modular exponentiation is to make use of something called Montgomery multiplication and Montgomery reduction. OP-TEE implements the Montgomery operations in the big number library, libmpa. The current implementation uses a binary Left to Right (LtoR) implementation. The LtoR implementation is vulnerable to timing attacks since it leaks information about the exponent in use, because it uses different amount of time in each loop when doing the exponentiation. The leaked information can be used to completely recover the private key. One mitigation to this attack is to change the implementation to a constant time exponentiation algorithm instead of LtoR. One such algorithm is the so called Montgomery powering ladder, which does the same amount of operations in every loop. I.e., it will always do square and multiply in every loop. The fix (Montgomery ladder) for the timing attack has been implemented in:
Patches
optee_os.git
Workarounds
N/A
References
OP-TEE ID
OP-TEE-2016-0003
Reported by
Applus+ Laboratories
For more information
For more information regarding the security incident process in OP-TEE, please read the information that can be found when going to the "Security" page at https://www.trustedfirmware.org.