lambdaclass / lambdaclass/eth-agent
Private keys remain in memory indefinitely - no secure cleanup
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Problem
The EOA class stores private keys in memory for the wallet's lifetime. There's no mechanism to securely zero-out sensitive key material when the wallet is no longer needed.
Location
src/protocol/account.ts - EOA class
Security Concern
- Private keys could be extracted from memory dumps
- Keys persist even after wallet is "done" being used
- No way for users to explicitly clear sensitive data
Recommendation
- Add a
destroy()method that zeros out the private key buffer - Document that users should call
destroy()when done with a wallet - Consider using
Uint8Arrayand explicitly zeroing bytes
destroy(): void {
// Zero out the private key
if (this.privateKey instanceof Uint8Array) {
this.privateKey.fill(0);
}
// Mark as destroyed to prevent further use
this._destroyed = true;
}
Priority
Critical - Security best practice for key management
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/protocol/account.ts at the EOA class and inspect how the private key is stored and used throughout the wallet lifecycle. Implement and document an explicit cleanup path so the key material is zeroed and the destroyed wallet cannot be used afterward; done means callers have a clear destroy() API and its behavior is covered by the surrounding account checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100