On Safenet HSM key-extraction vulnerability CVE-2015-5464 (part I)
The Safenet HSM implemented PKCS#11 key-derivation mechanisms that allowed a user to extract short fragments of a secret key and then brute-force them using HMAC operations. An attacker with access to the HSM could recover the full key, including elliptic-curve private keys, by repeating this process.
randomoracle.wordpress.com
Published on randomoracle.wordpress.com
This series of posts is provides a more in-depth explanation of the key-extraction vulnerability we discovered and reported to Safenet, designated as CVE-2015-5464.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the HSM allowed key-derivation mechanisms to produce short keys derived from secret keys and then permitted those derived keys to be used for HMAC, enabling offline brute-force of key fragments.
Impact
An attacker with access to the HSM could recover secret keys, including elliptic-curve private keys, by brute-forcing short derived key fragments; the text notes RSA, plain DSA and Diffie-Hellman were not affected.
What the attacker needed
Access to the HSM; ability to invoke key-derivation mechanisms; ability to perform HMAC with derived keys
How it was found
- Start with an existing 256-bit AES key with handle #37.
- Use the extract-key-from-key mechanism to extract a two-byte subkey from the original.
- Use the derived two-byte key to HMAC a chosen message.
- Brute-force the short key by trying all possibilities against the known message/HMAC pair.
- Repeat with different offsets until all key bytes are recovered.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A hardware security module (HSM) is a device that stores secret keys and performs cryptographic operations without revealing the keys. The PKCS#11 standard defines a way for software to talk to such devices. The bug was that one of the key-derivation functions let you create a new, shorter key from part of the original secret key, and because the new key was short it could be guessed by trying all possibilities. By repeating this, the whole secret could be recovered.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.