Skip to content

fix: zero temporary key buffers after keypair creation in CSV import#37

Closed
0x-SquidSol wants to merge 1 commit intonullxnothing:mainfrom
0x-SquidSol:fix/zero-key-buffers-after-csv-import
Closed

fix: zero temporary key buffers after keypair creation in CSV import#37
0x-SquidSol wants to merge 1 commit intonullxnothing:mainfrom
0x-SquidSol:fix/zero-key-buffers-after-csv-import

Conversation

@0x-SquidSol
Copy link
Copy Markdown

Summary

  • During CSV wallet recovery import, intermediate buffers (Buffer.from(hex) and bs58.decode()) containing raw private key bytes were left in memory after Keypair creation
  • These temporary buffers are now explicitly zeroed with .fill(0) immediately after the Keypair is constructed
  • Minimizes the window for key material exposure in process memory or heap dumps

Test plan

  • Import a CSV file with wallet keypairs — verify wallets load correctly
  • Verify recovery operations still work end-to-end
  • Run pnpm run typecheck — passes clean
  • Run pnpm run test — all wallet tests pass (19/19)

During CSV wallet recovery, intermediate buffers from Buffer.from() and
bs58.decode() containing raw private key bytes were left in memory after
Keypair creation. These temporary buffers are now explicitly zeroed with
.fill(0) immediately after use to minimize the window for key material
exposure in process memory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nullxnothing
Copy link
Copy Markdown
Owner

Closed as superseded by #75, which reapplies the corrected security hardening on top of current main. This avoids merging stale/conflicted branches and preserves the fixes with passing CI/CodeQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants