---
title: "Man-in-the-Middle Attack (MITM) — definition | Nuri Glossary"
description: "Someone sitting between two parties, reading or altering what passes between them."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/man-in-the-middle-attack"
---

# Man-in-the-Middle Attack (MITM)

Someone sitting between two parties, reading or altering what passes between them.

## Basically

An attacker secretly gets between you and the other person in a crypto transaction. They can read or change what you both send without either of you knowing.

## Key Takeaways

- A man-in-the-middle attack puts an attacker between two communicating parties. They can eavesdrop on, modify or replace messages without either side knowing. In crypto, this often means swapping wallet addresses or redirecting connections to steal funds.
- Common crypto MITM methods include clipboard hijacking malware that replaces copied addresses, BGP hijacking that reroutes internet traffic, and DNS attacks that redirect users to phishing sites.
- Defences work in layers. BIP-324 encrypts Bitcoin P2P traffic, TLS/HTTPS protects web wallets, hardware wallets provide trusted address verification, and Lightning's onion routing hides payment endpoints from intermediaries.

## What Is a Man-in-the-Middle Attack?

A man-in-the-middle (MITM) attack happens when an attacker secretly positions themselves between two parties who believe they are communicating directly. The attacker can read, modify or completely replace messages passing through them. NIST defines it as "an attack in which an attacker is positioned between two communicating parties in order to intercept and/or alter data traveling between them."
Traditional networking MITM attacks target login credentials, banking sessions and email. Cryptocurrency attacks are more targeted and carry higher stakes because a single intercepted transaction can cause irreversible loss of funds. Blockchain transactions cannot be reversed once confirmed, so attacks that redirect payments can cause permanent losses.
The attack does not require breaking any cryptographic algorithm. It exploits the gap between what you see and what actually happens on the network. Examples include a copied address that gets silently swapped, a DNS lookup that returns a malicious IP, or a P2P connection that routes through an attacker's infrastructure.

## How It Works

A MITM attack follows a general pattern regardless of the specific method. The attacker enters the communication path and intercepts the messages.
A well-executed MITM attack is hard to spot. Unlike a denial-of-service attack, it does not disrupt communication completely. It preserves the appearance of normal operation while silently manipulating the content.

## Clipboard Hijacking

Clipboard hijacking is the most common crypto-specific MITM method. Malware on your device monitors the system clipboard for strings matching cryptocurrency address patterns. When you copy a wallet address, the malware replaces it with an attacker-controlled address in milliseconds.
Kaspersky Lab discovered CryptoShuffler in October 2017. The trojan stole approximately 23 BTC, worth around $140,000 at the time, by monitoring clipboard contents and swapping Bitcoin, Ethereum, Zcash, Monero and Dogecoin addresses. The malware ran silently in the background, and victims discovered the theft only after funds arrived at an unknown address.
More sophisticated variants such as Laplas Clipper, discovered in 2023, pre-generate addresses that visually resemble your intended recipient's address. They exploit the common habit of checking only the first and last few characters of an address.

## DNS Hijacking

DNS hijacking redirects domain name lookups so that a legitimate URL resolves to an attacker-controlled server. Crypto attackers compromise DNS registrars or DNS infrastructure to serve pixel-perfect clones of wallet interfaces, exchange login pages or DeFi front-ends.
Attackers compromised the DNS registrar for Curve Finance in August 2022 and redirected users to a cloned site that requested malicious token approvals. Approximately $575,000 was stolen before the attack was detected. Similar attacks hit Cream Finance and PancakeSwap in March 2021 through compromised GoDaddy DNS credentials, with fake sites prompting users to enter seed phrases.

## BGP Hijacking

BGP hijacking exploits the trust-based nature of internet backbone routing. Attackers broadcast malicious BGP (Border Gateway Protocol) route announcements, causing internet routers to send traffic through attacker-controlled infrastructure instead of its intended path.
The most significant crypto BGP attack targeted MyEtherWallet in April 2018. Attackers hijacked BGP routes for Amazon's Route 53 DNS service and redirected MyEtherWallet.com queries to a Russian-hosted phishing site for approximately two hours, resulting in 215 ETH stolen, worth approximately $152,000. The fake site used an untrusted TLS certificate, so victims had to click through browser HTTPS certificate warnings.
Between February and May 2014, attackers from a Canadian ISP used BGP hijacking to redirect mining pool traffic from BTCGuild, Middlecoin and other pools. They stole approximately $83,000 in cryptocurrency over four months by rerouting miners' hashpower to attacker-controlled pool servers.

## Node API Interception

Web wallets and decentralised applications that communicate with blockchain nodes via HTTP/JSON-RPC can be vulnerable if the connection is unencrypted or the node endpoint is compromised. An attacker on the network path can intercept API calls and return falsified blockchain data. They can also manipulate transaction parameters before they reach the node.
API interception is related to eclipse attacks, where an adversary completely controls a node's view of the network. An eclipse attack isolates the node at the peer-to-peer level. API interception targets communication between you and the node you rely on for broadcasting transactions and querying balances.

## BIP-324 Encrypted P2P Transport

BIP-324 defines an encrypted transport protocol for Bitcoin peer-to-peer connections, replacing the original plaintext v1 protocol. Dhruv Mehta, Tim Ruffing, Jonas Schnelli and Pieter Wuille authored it, and Bitcoin Core 27.0 enabled it by default in April 2024.
The protocol uses ChaCha20-Poly1305 authenticated encryption. Elliptic Curve Diffie-Hellman (ECDH) on secp256k1 establishes the keys. A novel ElligatorSwift encoding converts the handshake's elliptic curve points into pseudorandom 64-byte strings, making the handshake indistinguishable from random data and preventing protocol fingerprinting.
BIP-324 provides opportunistic, unauthenticated encryption. It prevents passive eavesdroppers, including ISPs and nation-states, from identifying or tampering with Bitcoin P2P traffic, and forces adversaries to move from passive surveillance to active, detectable MITM attacks. You can layer authentication on top separately.

## TLS/HTTPS for Web Wallets

TLS (Transport Layer Security) encryption protects web-based wallets and exchanges by encrypting all data between your browser and the server. TLS 1.3 provides the strongest protections, and all legitimate wallet services should enforce HTTPS connections.
TLS alone does not prevent all MITM attacks. The MyEtherWallet incident showed that attackers who hijack DNS can present a different certificate, and some users clicked through the browser warning about the untrusted certificate. Defence in depth matters because no single layer is sufficient.

## Hardware Wallet Address Verification

Hardware wallets provide a trusted display controlled by a Secure Element chip isolated from the potentially compromised host computer. You verify the recipient address on the device's screen before signing, which defeats clipboard hijacking and screen-manipulation malware.
Researchers demonstrated the EthClipper attack in 2021. It pre-mines addresses visually similar to your intended recipient's address and achieved concerning match rates because users often verify only a few characters. You should always verify the complete address on the hardware wallet screen, not just the first and last few characters.

## Certificate Pinning

Certificate pinning hardcodes a specific TLS certificate or public key into a mobile application. During the TLS handshake, the app checks that the server's certificate matches the pinned value and refuses the connection if it does not match, even if the certificate is otherwise valid. The method defeats MITM attacks that rely on rogue certificates, compromised Certificate Authorities or DNS hijacking.

## Lightning Onion Routing

The Lightning Network uses source-based onion routing, defined in BOLT #4 and based on the Sphinx construction, to prevent intermediaries from learning payment endpoints. The sender wraps the entire route in layered encryption, so each forwarding node can decrypt only its own layer and see only the next hop. Intermediate nodes cannot determine the sender, the receiver or their position in the route.
The design prevents routing nodes from acting as effective MITM attackers because they lack the context needed to selectively intercept or censor specific payments. Combined with HTLCs that cryptographically bind payment preimages to each hop, the protocol ensures that intermediaries cannot redirect or steal funds in transit.

## MITM in the Context of Bitcoin and Layer 2

Bitcoin's cryptographic foundations provide strong protection against certain MITM scenarios. Every transaction requires a valid digital signature from the private key controlling the funds, so an attacker who intercepts it in transit cannot modify the recipient or amount without invalidating the signature. The MITM threat in Bitcoin concerns manipulating what gets signed in the first place, not altering signed transactions.
Layer 2 protocols like Spark inherit Bitcoin's signature-based security while adding their own protections. Spark uses FROST threshold signatures for cooperative operations, meaning multiple parties must independently validate and co-sign state transitions. A single compromised communication channel cannot unilaterally redirect funds because the protocol requires agreement from multiple independent signers.
Tor adds another defence layer for Bitcoin and Lightning connections by routing traffic through multiple encrypted relays. Network-level attackers find it significantly harder to identify and intercept specific connections. If you use an adversarial network environment, combining Tor with BIP-324 provides defence in depth against both traffic analysis and active interception.

## Practical Prevention Checklist

You need layered defences against MITM attacks. These defences must cover different parts of the transaction flow.

## Evolving Attack Sophistication

MITM attacks continue to grow more sophisticated. Early clipboard hijackers simply swapped addresses at random, while modern variants like Laplas Clipper generate visually similar addresses that pass a quick inspection. DNS and BGP attacks have moved from opportunistic to targeted, with attackers obtaining valid TLS certificates to avoid browser warnings entirely, as in the 2022 KLAYswap attack where attackers obtained a legitimate certificate via ZeroSSL for the hijacked domain.

## Defence Gaps

No single defence eliminates MITM risk. BIP-324 encrypts P2P traffic but provides opportunistic rather than authenticated encryption, so it raises the cost of MITM from passive to active without preventing a sufficiently positioned attacker from carrying out active interception. TLS protects the transport layer but relies on certificate authorities and DNS infrastructure, both of which have been compromised in documented attacks, while hardware wallets protect signing only if you actually verify addresses on the device screen.

## Supply Chain and Side-Channel Risks

MITM attacks can target the supply chain itself through compromised wallet software, tampered hardware devices or malicious browser extensions that intercept transactions before any network-level protection applies. These side-channel and supply chain attacks bypass transport encryption entirely because the attacker operates within the trusted endpoint. For a deeper analysis of these methods, see the research on wallet security attack surfaces and hardware wallet attack vectors.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
