Using zeroize-on-drop in mc-transaction-core #2717
Labels
security
Public issues which impact security impact
transaction-core
Area: Rules defining a valid transaction and its structure
Historically, most objects in transaction-core did not implement
Zeroize
.This is because
curve25519-dalek::RistrettoPoint
did not implementZeroize
and so it was impossible.Now, it does implement
Zeroize
, but notdrop(Zeroize)
. This means, we know how to zeroize it, but it is not automatically zeroized on drop. Many (maybe not all?) sensitive types inTransactionCore
also deriveZeroize
now.Generally, we want "secrets" to be zeroized on drop. This represents an implementation hardening step that can protect against information leaks, by reducing the window for an adversary who has hacked into your device from obtaining secrets that are resident in memory.
However, in a typical transaction almost everything is a secret in our model. Not only are your private keys a secret, but also who you are sending money to is a secret.
tx_private_key
should be zeroized on droptx_out_shared_secret
should be zeroized on dropZeroizing on drop has additional consequences.
Drop
types cannot beCopy
. Some types likeCompressedRistrettoPublic
areCopy
.Prost
.This issue tracks discussion and implementation around:
An alternative approach is:
Zeroizing
wrappers around types that implementZeroize
. This has other tradeoffs compared to using Zeroize on drop.One basic step we can take is, try making
Tx
objectZeroize
on drop and test if this has performance implications for the consensus network. IIRC a large part of the consensus enclave has to do with deserializing these objects, calling validate by passing a reference, and then possibly re-encrypting it and passing it to peer enclaves, and there is not much reason to make copies of parts of theTx
for other purposes, so this change may clean up a large number of secrets on its own. Then we can follow up by seeing what copies of secrets if any are made duringTx
validation and ensure that we clean up those also.Tx
object zeroize itself on drop #2925The text was updated successfully, but these errors were encountered: