Damus
Thanh-Hai Tran profile picture
Thanh-Hai Tran
@th2tran
Lol, a morbidly accurate way to pinpoint the root cause of the ColdCard hack.
In a March 2021 firmware rewrite (version 4.0.0), Coldcard integrated a new cryptography library. The library had a built-in safety guard to check whether the device's hardware random number generator (the dice roller) was active. However, the guard used a C macro that only checked if the macro variable was defined, rather than checking if its value was true. Because Coldcard had it defined as 0 (false), the compiler bypassed the safety check. Because of this macro failure, the device completely ignored its secure hardware entropy source. It silently fell back onto a highly predictable, software-based pseudorandom number generator. This severely lowered the randomness of the generated 24-word seed phrases, turning a supposedly secure cryptographic wall into a searchable, predictable pool that hackers cracked entirely offline.