Man-in-the-Middle Attack
A Man-in-the-Middle (MITM) attack occurs when an attacker secretly intercepts and alters communication between a user and a blockchain service, such as changing wallet addresses during transactions.
What Is Man-in-the-Middle Attack?
A man-in-the-middle attack (MITM) is one in which an attacker sits between two parties who believe they are talking to each other directly, and reads or changes what passes. Classic settings are a rogue Wi-Fi hotspot, a compromised router, forged DNS answers or a malicious proxy.
On the web the defence is TLS (HTTPS): an attacker on the network cannot read or alter a properly encrypted connection without causing a certificate warning. In practice, crypto theft from the middle rarely breaks encryption. It goes around it, with a phishing site that relays to the real one, a browser extension that rewrites pages, or malware that replaces an address on the clipboard or in the wallet app.
A hardware wallet is designed for the case where everything between you and the blockchain is hostile. The transaction is signed inside the device, and its screen shows the recipient and amount that are actually being signed. If the computer, the cable or the app has altered the address, the device shows the altered one, which helps only if you compare it with an address obtained through an independent channel.
The link between app and device can be a target too. Some devices encrypt it, and air-gapped devices pass data by QR code or microSD card instead. Neither replaces reading the screen.
Real-World Examples
Example 1: On hotel Wi-Fi an attacker redirects a user to a copy of an exchange's login page. The password manager refuses to fill in the password because the domain does not match, and the user leaves.
Example 2: Malware on a laptop swaps the recipient address in the wallet app. After the QR code is scanned, the Ngrave Zero shows the swapped address; the user compares it with the address the recipient sent through a messenger and rejects the transaction.
Example 3: When pairing a BitBox02 with its app, the user checks that the pairing code on the device matches the one in the app, which confirms that nobody sits in between on the USB link.
Frequently Asked Questions
Does HTTPS protect me against a man-in-the-middle attack?
Against an attacker on the network, largely yes: a properly encrypted TLS connection cannot be read or altered without causing a certificate warning. In practice, crypto theft from the middle rarely breaks encryption. It goes around it, with a phishing site that relays to the real one, a browser extension that rewrites pages, or malware that replaces an address.
My hardware wallet shows the recipient address. Is that enough to detect a swapped address?
Only if you compare it with something trustworthy. The device shows the address that is actually being signed, so an address altered by the computer, the cable or the app appears there in its altered form. Compare it with an address obtained through an independent channel, such as one the recipient sent you separately, and reject the transaction if they differ.
Does an encrypted or air-gapped link between app and device prevent these attacks?
It protects the link itself, but it does not replace reading the screen. Some devices encrypt the connection to the app or let you compare a pairing code on the device with the one in the app; air-gapped devices pass data by QR code or microSD card. A transaction altered on the computer before it reaches the device is still shown only on the device screen.
Ready to Choose a Secure Wallet?
Use our tools to find the right hardware wallet for your needs.