Researchers Discover Way to Hack Hardware Security Module, Gain Access to Cryptographic Keys

Everyone be cool, this is one heckuva robbery!

Larry Loeb, Blogger, Informationweek

June 11, 2019

3 Min Read

Ledger researchers Gabriel Campana and Jean-Baptiste Bédrune of the crypto-hardware wallet Ledger announced at the annual French security conference SSTIC they had found a way to remotely hijack a hardware security module (HSM). They show how an attacker could gain complete access to the keys and secrets stored on the HSM.

Their paper, "Everybody be cool, this is a robbery!", is in French, but the researchers announced that they will be presenting at Black Hat in August in English.

As the authors pointed out in their Black Hat announcement, "HSMs are widely used by cryptocurrency exchanges to secure crypto assets, by banks to protect cryptographic keys and customer PINs, and by telecommunications operators to manage SIM secrets. Basically, HSMs generate, store and protect cryptographic keys and rely on software and hardware mechanisms to prevent secrets from being stolen."

As far as the revelations go, they also say in the presentation announcement that; "It will demonstrate several attack paths, some of them allowing unauthenticated attackers to take full control of the HSM. The presented attacks allow retrieving all HSM secrets remotely, including cryptographic keys and administrator credentials. Finally, we exploit a cryptographic bug in the firmware signature verification to upload a modified firmware to the HSM. This firmware includes a persistent backdoor that survives a firmware update."

Everyone be cool, this is one heckuva robbery!

The bilingual team at Cryptosense have translated a brief summary of the methods used, and published them in English.

Cryptosense summarized the attack this way:

  • "They started by using legitimate SDK access to their test HSM to upload a firmware module that would give them a shell inside the HSM. Note that this SDK access was used to discover the attacks, but is not necessary to exploit them.

They then used the shell to run a fuzzer on the internal implementation of PKCS#11 commands to find reliable, exploitable buffer overflows.

They checked they could exploit these buffer overflows from outside the HSM, i.e. by just calling the PKCS#11 driver from the host machine

They then wrote a payload that would override access control and, via another issue in the HSM, allow them to upload arbitrary (unsigned) firmware. It's important to note that this backdoor is persistent – a subsequent update will not fix it.

They then wrote a module that would dump all the HSM secrets, and uploaded it to the HSM."

The HSM module manufacturer (who is not named in the paper) has been notified, and some sort of patch is available from them.

What worries the Cryptosense team most is that a well-funded vulnerability research team at state-level intelligence agencies could have carried out similar work and already discovered this attack. Because it leaves an unfixable backdoor, such hijackers could currently be in deployment.

This HSM attack must cause rethinking and replanning of all HSM usage. If the very function of an HSM has been bypassed and can not be assured to function in the future, the reason to utilize it in the first place has been negated.

— Larry Loeb has written for many of the last century's major "dead tree" computer magazines, having been, among other things, a consulting editor for BYTE magazine and senior editor for the launch of WebWeek.

Read more about:

Security Now

About the Author

Larry Loeb

Blogger, Informationweek

Larry Loeb has written for many of the last century's major "dead tree" computer magazines, having been, among other things, a consulting editor for BYTE magazine and senior editor for the launch of WebWeek. He has written a book on the Secure Electronic Transaction Internet protocol. His latest book has the commercially obligatory title of Hack Proofing XML. He's been online since uucp "bang" addressing (where the world existed relative to !decvax), serving as editor of the Macintosh Exchange on BIX and the VARBusiness Exchange. His first Mac had 128 KB of memory, which was a big step up from his first 1130, which had 4 KB, as did his first 1401. You can e-mail him at [email protected].

Keep up with the latest cybersecurity threats, newly discovered vulnerabilities, data breach information, and emerging trends. Delivered daily or weekly right to your email inbox.

You May Also Like


More Insights