Crypto Wallet Security
- Biohazard

- Jul 16
- 4 min read

Cryptocurrency Wallet Security
Here's a comprehensive crypto wallet security assessment methodology from an attacker's perspective. This article / guide is on crypto wallet security.
Crypto Wallet Security Assessment Methodology
Phase 1: Information Gathering & Reconnaissance
Identify wallet type:
Custodial (exchange-hosted — Coinbase, Binance) vs. Non-custodial (self-hosted — Electrum, MetaMask, Ledger)
Hot (online, connected) vs. Cold (offline, air-gapped)
Software (desktop/mobile/browser) vs. Hardware (dedicated device)
Tooling fingerprinting:
What wallet software and version?
Which BIP standards implemented? (BIP32/39/44/49/84/86)
Backend infrastructure (Infura, Alchemy, self-hosted node?)
Mobile: is Secure Enclave / TEE used? Keychain / Keystore implementation?
Desktop: how is the seed stored? Encrypted JSON? Plaintext memory?
Phase 2: Attack Surface Categories
2A — Seed Phrase / Private Key Extraction
Attack Vector | Technique |
Memory dumping | Process dump of wallet app while unlocked. Search for BIP39 words, entropy, or raw private keys in heap. Tools: procdump, volatility, WinDbg |
Clipboard hijacking | Malware monitoring clipboard for copied addresses, seed phrases. Pastejacking — swap destination address on copy |
TEMPEST / Van Eck phreaking | Electromagnetic emissions from screen/keyboard during wallet typing. Hardware attack, but demonstrated against offline wallets |
Side-channel timing | Timing analysis of signature operations to recover ECDSA nonces |
Cold boot attack | Reboot machine without powering off; dump RAM for keys (works best on unencrypted systems) |
Swap file / hibernation file | Keys may be paged to disk. Extract from pagefile.sys, hiberfil.sys, /var/vm/swapfile |
Keylogger / screen capture | Capture seed phrase entry during wallet creation or restore |
2B — Network & Communication Attacks
Attack Vector | Technique |
RPC endpoint exposure | Wallet software often exposes JSON-RPC on localhost. If misconfigured (e.g., rpcbind=0.0.0.0), external access possible. Default ports: 8332 (Bitcoin Core), 8545 (Ethereum) |
Man-in-the-middle | Unencrypted RPC, HTTP-based sync, or DNS spoofing of blockchain data feeds |
Sybil / Eclipse attack | Isolate wallet node from honest peers; feed fabricated blockchain data to manipulate balances or double-spend |
Blockchain data poisoning | Malicious inscriptions in transaction data executed when wallet parses tx history |
Infura / RPC provider compromise | Wallets using default providers (Infura, Alchemy) — provider can log IPs, correlate addresses, or serve malicious data |
2C — Application Layer Vulnerabilities
Attack Vector | Technique |
Dependency chain | Audit package.json, requirements.txt, Cargo.lock — known CVEs in web3.js, ethers.js, bitcoinj, libsecp256k1 |
RNG weakness | Check if wallet uses Math.random() (predictable) vs. CSPRNG. The Android Bitcoin Wallet (2013) bug — 50 BTC lost due to weak RNG |
Replay attacks | If nonce reuse occurs across chains (ETH + ETH Classic), signatures can be replayed |
Transaction malleability | Modify raw tx before broadcast (BTC case: Mt. Gox exploited this) |
Reused address derivation | HD wallet fingerprinting — if a parent public key is leaked, all child addresses can be discovered |
Proxy re-encryption flaws | Browser extension wallets (MetaMask) — cross-origin communication, window.ethereum injection, malicious dApp draining |
2D — Hardware Wallet Specific
Attack Vector | Technique |
Firmware downgrade | Flash older firmware with known vulnerabilities |
Supply chain | Device tampered before delivery — compromised RNG, pre-loaded keys |
Side-channel (power/EM) | SPA/DPA on ECDSA signing — recover key from power consumption traces |
Chip glitching | Voltage or clock glitching to bypass PIN verification or read protected memory |
Debug interface | JTAG/SWD exposed on production boards — read flash directly |
PIN bypass | Physical: microprobing memory bus. Logical: extracting PIN from host software |
2E — Social Engineering / Phishing
Attack Vector | Technique |
Fake wallet app | Clones in app stores (iOS/Android) or GitHub repos with backdoored seed generation |
Seed phrase phishing | Fake "wallet restore" sites, fake Ledger Live updates, "validate your wallet" scams |
SIM swap | Bypass 2FA on exchange accounts to withdraw custodial funds |
Fake hardware wallet | Clone devices with known keys or remote kill switch (see: Ledger supply chain 2023 counterfeit reports) |
Phase 3: Testing Methodology Checklist
For each wallet under test:
Extract seed phrase from memory dump (unlocked state)
Extract seed from encrypted storage (brute-force weak passphrases)
Test RPC endpoint exposure (local + if accidentally exposed)
Check TLS cert validation on all API calls
Audit random number generation source
Verify HD derivation path conformity (BIP44)
Check for deterministic nonce reuse (ECDSA)
Review dependency tree for known CVEs
Test clipboard manipulation resistance
Verify firmware authenticity (hardware wallets)
Check physical debug interface exposure (hardware)
Attempt firmware downgrade (hardware)
Review logging: are addresses/keys written to disk/logs?
Check for wallet file encryption strength (weak KDF? pbkdf2 iterations?)
Test multi-sig setup verification (does UI show correct co-signers?)
Verify withdrawal address whitelist bypass (exchange wallets)
Phase 4: Tools
Category | Tools |
Memory forensics | Volatility (plugins: bitcoin_wallet, ecdsa_keyfind), Rekall, LiME |
Blockchain analysis | OXT (oxt.me), Chainalysis Reactor, Blockchair, BitIodine |
Fuzzing | LibFuzzer + custom harness for tx parsing, AFL for wallet binaries |
Static analysis | Slither (Solidity), Mythril, ConsenSys Diligence tools, semgrep rules for wallet code |
Side-channel | ChipWhisperer (power/EM), HiFive (glitching), Proxmark3 (RFID) |
Network | Nmap (RPC exposure), mitmproxy (intercept wallet traffic), Wireshark |
Hardware | Bus Pirate, J-Link (JTAG/SWD), Saleae logic analyzer, hot air station (chip-off) |
Phase 5: Risk Scoring
Finding | Severity | Example |
Seed phrase in plaintext memory | Critical | bitcoind without encryption |
Weak RNG | Critical | Predictable wallet generation |
RPC exposed to network | High | rpcallowip=0.0.0.0 |
Nonce reuse | High | ETH tx with same v, r, s |
PIN bypass via firmware downgrade | High | Ledger Nano firmware downgrade |
Untrusted RPC provider | Medium | Default Infura logs all requests |
Clipboard monitoring | Medium | Any wallet not using direct paste prevention |
Deterministic wallet fingerprinting | Low | BIP44 gap limit analysis |






Comments