Wallet Security
Cryptocurrency wallets are the primary target for attackers. Understanding wallet architecture and common attack vectors is crucial.
Authorised Targets Only
Wallet Types & Attack Surfaces
Hot Wallets
- Browser extensions (MetaMask)
- Mobile apps
- Web wallets
- Exchange wallets
Cold Wallets
- Hardware wallets (Ledger, Trezor)
- Air-gapped computers
- Multisig smart accounts (Safe)
- Offline or steel seed backups
Common Attack Vectors
Most of what an individual wallet loses arrives as a signature, not an exploit. Chainalysis counted 158,000 personal-wallet compromises affecting at least 80,000 victims in 2025 — $713M, or 20% of all value stolen that year — and the vectors below are the ones a holder meets most often.
| Vector | Mechanism | What to check |
|---|---|---|
| Seed phrase theft | Phishing sites mimicking a wallet, malicious extensions, clipboard hijacking, social engineering. | Whether the phrase was ever typed into a web page or stored digitally. |
| Malicious transactions | Blind signing, approval for a max uint256 spend, contract interactions that transfer instead of stake. |
The decoded calldata and the exact approval amount, per transaction. |
| Fake token attacks | Airdropped tokens with a malicious transfer(), or names impersonating a real token. |
The token contract address, not the ticker. |
| Address poisoning | Small transfers from an address with the same leading and trailing characters, so history shows a look-alike. | The full address, character by character, before every send. |
| EIP-7702 delegation | A signed authorisation (account abstraction) sets the account's code to an attacker contract, which then has unrestricted access: it can move existing funds and sweep anything that arrives later. The delegation persists until it is overwritten or cleared. | Whether the account's code is a 0xef0100 delegation indicator, and which address it points at. |
Approvals are the measurable half of this. Enumerate them rather than trusting a dashboard, because a revoke.cash or explorer view only shows what it indexed:
# What has this owner approved, and for how much?
cast call $TOKEN "allowance(address,address)(uint256)" $OWNER $SPENDER --rpc-url $RPC
# Revoke by setting the allowance back to zero, signed by the owner.
# Sign on a hardware wallet: never put a mainnet private key in a shell
# command or your shell history.
cast send $TOKEN "approve(address,uint256)" $SPENDER 0 --rpc-url $RPC --ledger
# revoke.cash and the explorer approval views are fine for a first pass,
# but confirm anything important with the two calls above.A multisig only helps if the signers see what they are signing. The Bybit loss in this section's hack table came from a compromised signing interface that displayed a benign transaction while the payload handed the attacker control of the Safe — and every signer approved it. Verify the transaction hash on the hardware device or an independent interface, and treat a web UI's decoded view as a convenience rather than evidence.
Analyzing Wallet Extensions
An installed extension is already unpacked on disk, so inspect it there first — that copy is what the browser
actually loaded. Only downloaded .crx
packages need unpacking, and they are not ZIP files: CRX3 prefixes the ZIP payload with a magic value and a
protobuf header, so unzip extension.crx
fails with "cannot find zipfile directory".
# Installed extensions are already unpacked
# Windows: %LOCALAPPDATA%\Google\Chrome\User Data\Default\Extensions
# Linux: ~/.config/google-chrome/Default/Extensions
ls ~/.config/google-chrome/Default/Extensions
# CRX3 layout: "CrX3" magic | 4-byte protobuf length | protobuf header | ZIP
# Find the ZIP local file header (PK\x03\x04) and cut from there
python3 - <<'EOF'
data = open('extension.crx', 'rb').read()
start = data.find(b'PK\x03\x04')
assert start > 0, 'no ZIP payload found'
open('extension.zip', 'wb').write(data[start:])
EOF
unzip extension.zip -d extension_unpacked
cat extension_unpacked/manifest.json
# What to review once it is open
# - Where the private key or seed is stored, and how it is encrypted
# - Which host permissions the manifest requests (all_urls?)
# - Content scripts injected into pages, and the APIs they expose
# - Any remote endpoint in the bundle
grep -rnoE "https?://[a-zA-Z0-9./_-]+" extension_unpacked --include="*.js" | head -50
grep -rn "BEGIN" extension_unpacked 2>/dev/nullExtension Review Is Browser-Side Testing
Related Topics
DeFi Attacks
Where the approved funds end up once a protocol or oracle trusts a manipulable value.
NFT Security
setApprovalForAll is the NFT-shaped version of the unlimited approval described here.
Web Penetration Testing
The web-layer classes that sit between the user and the wallet prompt: XSS, CSRF, SSRF and authentication bypass.