fix: Add confirmation dialog before broadcasting a transaction - #45
Open
lakshyaog wants to merge 2 commits into
Open
fix: Add confirmation dialog before broadcasting a transaction#45lakshyaog wants to merge 2 commits into
lakshyaog wants to merge 2 commits into
Conversation
Security Fix: - Added immediate key zeroing in encryptMnemonic() after encryption - Added immediate key zeroing in decryptMnemonic() after decryption - Prevents memory dump attacks by destroying sensitive cryptographic material - Keys are now zeroed using Buffer.fill(0) immediately after use Issue: AWS KMS plaintext data keys were persisting in RAM after encryption/ decryption operations. If an attacker gained access to process memory (via memory dump, debugging, or system compromise), they could extract these keys and decrypt any mnemonic encrypted with them, leading to complete wallet compromise. Solution: The fix ensures plaintext keys are overwritten with zeros immediately after cryptographic operations, following security best practices for handling sensitive key material. This matches the existing security patterns used in btc-controller for private key handling. Testing: - Added test-key-zeroing.js to verify basic key zeroing functionality - Added test-actual-fix.ts to verify encryption/decryption with zeroing - Added SECURITY-FIX-VERIFICATION.md with complete documentation - All tests pass successfully Impact: - Eliminates memory-based key extraction vulnerability - Provides production-grade security for wallet operations - No breaking changes to existing API
Resolves Swapso-App#44 - Users now see a summary screen showing recipient address, amount, fee rate, and total deducted before the transaction is signed and broadcast. They can cancel or confirm from this modal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #44 — Adds a transaction confirmation modal that displays all details before broadcasting.
Changes
sendTransaction()into a validation + confirmation step and a separatebroadcastTransaction()function that only executes after user confirmation.How it works
Testing