Is there an existing issue?
Motivation
Felt is not zeroized on drop which might leak sensitive information into RAM, notably private keys used by Signers such as LocalWallet.
This is especially an issue when considering block signing which uses Felt in p2p context or for the future Tendermint consensus system in Starknet, where an adversarial validator could sign faulty blocks with the pk of another sequencer, resulting in a slashing attacks.
This is still not very serious, as there certainly are simpler ways for a pk to leak, but it seems like this should at least be an option for secutiry.
Request
Support zeroing for sensitive information in starknet-signers, starknet-crypto and starknet-core.
Solution
Since the use of Felt is based on starknet_types_core, a relevant issue has been opened there. An associated issue has also been opened on lambdaworks-math. Note that it would still be possible to manually implement zeroing on Felt through a custom trait, but this would be less clean and more error-prone since it would not be called automatically on drop.
Are you willing to help with this request?
Yes!
Is there an existing issue?
Motivation
Feltis not zeroized on drop which might leak sensitive information into RAM, notably private keys used by Signers such as LocalWallet.This is especially an issue when considering block signing which uses
Feltin p2p context or for the future Tendermint consensus system in Starknet, where an adversarial validator could sign faulty blocks with the pk of another sequencer, resulting in a slashing attacks.This is still not very serious, as there certainly are simpler ways for a pk to leak, but it seems like this should at least be an option for secutiry.
Request
Support zeroing for sensitive information in
starknet-signers,starknet-cryptoandstarknet-core.Solution
Since the use of
Feltis based onstarknet_types_core, a relevant issue has been opened there. An associated issue has also been opened onlambdaworks-math. Note that it would still be possible to manually implement zeroing onFeltthrough a custom trait, but this would be less clean and more error-prone since it would not be called automatically on drop.Are you willing to help with this request?
Yes!