The incident report https://bugzilla.mozilla.org/show_bug.cgi?id=2083449#c82 confirms a long held suspicion: HSMs are not what they're supposed to be.
The key phrase is:
Decision (mid‑Apr 2025) to generate the B/C keys on the HSMs available before the June 2025 root store policy changes and to transfer them by key wrapping.
What does "key wrapping" mean?
Key wrapping is a cryptographic technique used to securely transfer or store encryption keys by encrypting them with another key, known as a Key Encryption Key (KEK). In the eMudhra incident, a custom Python script was used to migrate private CA keys between HSMs from different manufacturers, exposing the keys in plaintext in host memory. A programming error during this process reduced some ECDSA private keys to just 8 bits of entropy, making them trivially recoverable.
This says for me clearly: The HSM is just used as smoke and mirrors. It is possible to export the supposedly securely stored private key. From this point on, the HSM becomes just a bullet point in a marketing slide.
It has lost it's raison d'être.
And from how the words are chosen, this doesn't seem to be an uncommon procedure.
The questions raised by @fluepke are very valid ones: https://chaos.social/@fluepke/117594259242217211
I am angry about the "final" incident report, that #eMudhra has published:
https://bugzilla.mozilla.org/show_bug.cgi?id=2083449#c82
It raises questions:
- How the f*ck was the wrapped key "unwrapped" on the host? Exploit or wrong / insecure HSM usage?
- The RSA keys were also compromised, as they left the HSM and were present in plaintext within the host RAM?
- Can, we finally, get to see the damn source code used in the KGC??
- Why where the RSA certs only revoked on 7th Nov??
The incident seems much worse than just the 4.
@masek @fluepke That's not a secret or anything. It's all a big smoke show.
HSMs work by handwaving and "Trust us, our propritary bullshit firmware is very secure".
It's standard security and compliance theatre.
In some HSMs, you can mark keys as unexportable. That's useful. You have to do this, though :)