feat: zeroize cryptographic secrets on drop #988
No reviewers
Labels
No labels
DB & Storage
Deployment
Error Handling & Logging
Maintenance
Payment Backend
backport
backport v0.13.x
backport v0.14.x
backport v0.15.x
bindings
blocked
bug
cdk-sql
ci
cli
deps
documentation
duplicate
enhancement
good first issue
help wanted
invalid
keep-open
ldk-node-ui
migrations
mint
mutation-testing
needs rebase
needs review
new nut
nut change
question
ready
rust-version
rustfmt
stacked hold
stale
testing
wallet
weekly-report
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cashubtc/cdk!988
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "zeroize_on_drop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
implement zeroize on Drop for Secret, Wallet, and MultiMintWallet
this erases sensitive memory addresses before deallocation
Description
Minor security improvement that prevents a memory dump, swap file, or process memory inspection attack from exposing secrets left in deallocated memory addresses.
This is good hygiene and could be useful as part of a defense in depth strategy. Currently, it doesn't accomplish much because the master seed is kept in Wallet memory for the duration of the process.
A more meaningful security improvement would be to encrypt the seed on disk and load it into memory only when actively deriving keys. This would have a high performance impact due to the high frequency of ecash operations. Perhaps a better approach would be to focus on device architectures with a secure computing environment such as a secure enclave on a mobile phone and using something like VLS on mint servers.
In any case this PR has very low performance impact and it's better than nothing.
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just final-checkbefore committing#979
ACK
951ff054fb