Analysis of A Hardware Security Module's
Analysis of A Hardware Security Module's
Editors: Peter Gutmann, [email protected] | David Naccache, [email protected] | Charles C. Palmer, [email protected]
The HSM
77
Crypto Corner
High-Availability
Operation
Undeleting Keys
Normally, the library will correctly
handle an HSM that drops out and
later rejoins the group. It replays the
operations that have been done on
78
the group but not on the droppedout HSM. Consider this sequence
of events, with HSMs A and B:
1. A, B, and the library are online
and working.
2. B fails and drops out.
3. The application initiates a key
deletion, and the client library
instructs A to delete a key.
4. B rejoins the HA group.
5. The client tells B to delete the
same key that A deleted.
However, if the library crashes
while deleting a key, it wont handle
the case correctly. Consider this
sequence of events:
1. A, B, and the library are online
and working.
2. B fails and drops out.
3. The client instructs A to delete
a key.
4. The client crashes.
5. The client comes back up.
6. B rejoins the cluster.
7. The client extracts the same key
it deleted in step 3 from B and
reimports it into A.
So, the recovery protocol reinstates a key that should have been
deleted. This failure occurs because
the library doesnt keep a shared,
persistent transaction log. So, it
cant distinguish the case in which
it crashed before cloning a key from
B to A from the case in which it
crashed before deleting a key from
B that A had already deleted.
The simplest fix for the undeleted-key problem would be for
the library to implement a shared
transaction protocol that ensures
that actions are completed either
across the cluster or not at all. Such
protocols have been around for
a long time; one of the simplest
implementations would be for the
library to log each action when it
completes. Once an action has
successfully completed across all
HSMs in an HA group, the library
Stealing Secrets
Backups involve using two tokens
to derive an encryption key. Secrets
on one HSM are encrypted with
this key and then sent to the second HSM, where theyre decrypted
using the same key. Secrets are thus
always encrypted in transit.
Furthermore, the HSMs designers aimed to implement separation
of duties by requiring at least two
tokens to set up a successful backup.
Well call one the owner token, KO,
and the other the backup token, KB .
And its true: you cant back up and
restore using only one of the tokens;
you need both. This was also supposed to hold true for network
replication in an HA group. But
fatally, only the backup token must
be identical. In other words, the following scenario is possible:
May/June 2013
1. An HA group with A and B is HSM, which can split KB into two documentation without conductconfigured and operational. Both parts such that HA group setup ing tests of its own will simply never
A and B are set up using KO requires both shares. One part of the consider the Case of the Unauthorand KB .
split token would go to the backup ized HA Group Member.
The best anyone can do in these
2. KB s legitimate owner buys HSM operator; the other part could go
circumstances
is guess. However,
E and sets it up using KB and KE , to KO s owner. This would require
wed
be
very
surprised if those
the key that came with E.
both token shares owners to be
guesses
werent
off by orders of
3. KB s owner adds E to the HA physically present at backup and HA
magnitude,
even
if
made by equally
group. (This requires either group setup and would effectively
competent
people
in
the field. Wed
access to the HSMthat is, the reinstate separation of duties.
love
to
conduct
a systemHSMs administraatic
study
on
this
topic; if
tive passwordor
High availability can lead to the seeming
youre
interested
in paraccess to an existing
paradox
in
which
each
device
is
secure
ticipating,
drop
us
a line.
client application
that is, the applicaindividually but the high-availability
tion user password on
Effective
group exhibits security problems.
the client machine.)
Workarounds
4. Synchronization of
Are Easy to Find
the HA group (now
If you know you need
consisting of A, B, and E) Lessons Learned
them. The workarounds for the two
occurs.
From our experience with this flaws discussed here are hardly rocket
5. A and B wrap their secrets HSM, we learned four lessons.
science. They do increase operausing a key derived from KB
tional costs somewhat, especially for
and export them to the client Risk Analysis Cant
setting up an HA group, but by and
library, which forwards them Anticipate Failures
large, both solutions are fairly cheap.
to E.
Risk assessment methodologies We therefore argue that its worth6. E can decrypt the wrapped se- make rational decisions about while to subject security solutions to
crets because theyre encrypted investment: the cost to prevent a various tests before using them operusing key material from KB but certain risk must not exceed the ationally, to uncover potential flaws
not from KO. So, it doesnt mat- cost when that risk occurs. To be and find effective workarounds.
ter that E was set up using KE in- effective, risk assessments must be
We anticipate a seemingly reastead of KO.
fairly accurate, but of course, this is sonable response to this, which
7. The owner of E and KB can now an exercise in making predictions would be simply to use every availuse the secrets on E because about the future. (The dangers of able security mechanism in the hope
KE allows access to them. The which have been attributed vari- that this shotgun approach will mitisecrets are no longer protected ously to Niels Bohr and Yogi Berra.) gate some unknown risks. Howby the legitimate KO.
We challenge any risk assessment ever, turning all security features
8. Es owner can now also make a methodology to come up with risk up to 11 in this way might come
backup of E using KB and KE .
numbers before and after learning at the price of losing those features
about these two flaws that are even usability. This is because those feaIn this scenario, Es owner wont close to being equal. This is because tures use is no longer motivated by
have access to the plaintext versions the HSM was apparently designed a comprehensive analysis of security
of the secrets that were stored on to anticipate the threat of unauthor- threats but by a blind, unjustifiable
A and B. However, Es owner now ized backups: its expected mode of hope that some unknown threat
has access to a machine that will let operation should have made the might be mitigated.
him or her encrypt and, more cru- attack impossible. However, such
cially, sign any message using those attacks are possible, and a close read- Composing Systems
secrets. If the illegally cloned HSM ing of the HSMs documentation Might Lead to Surprises
was, for example, VeriSigns, Es reveals that owner tokens are never High availability can lead to the
owner would now be able to sign constrained to be equal for all HSMs seeming paradox in which each
certificates using VeriSigns root cer- in an HA group. However, this device is secure individually but
becomes apparent only after the flaw the high-availability group exhibtificate authority key.
The workaround for this prob- is uncovered. So, risk assessment its security problems. This is a corlem is to use another feature of the that considers only the products ollary of the uncomposability of
www.computer.org/security
79
Crypto Corner
Register today!
http://csf2013.seas.harvard.edu/
Neuhaus is a senior
researcher in the Communication
Systems Group at ETH Zurich.
Contact him at neuhaust@tik.
ee.ethz.ch.
Stephan
80
May/June 2013