Skip to content
Fast-turnaround security assessments available — 10+ years development & security experienceGet started
Back to Glossary
Glossary2 min read

Man-in-the-Middle (MitM)

An attack where an adversary secretly intercepts and potentially alters communication between two parties who believe they are communicating directly.

A man-in-the-middle (MitM) attack occurs when an attacker positions themselves between two communicating parties, intercepting and potentially modifying the data exchanged. Both parties believe they are communicating directly with each other, unaware that an intermediary is reading or altering their messages.

How It Works

MitM attacks exploit the trust established during network communication. The attacker must first gain a position in the communication path. On local networks, this is commonly achieved through ARP spoofing, where the attacker sends forged ARP messages to associate their MAC address with the IP address of the default gateway. All traffic intended for the gateway then flows through the attacker's machine.

DNS spoofing redirects domain name lookups to attacker-controlled servers. Rogue Wi-Fi access points mimic legitimate networks, causing devices to connect through attacker infrastructure. BGP hijacking redirects internet traffic at the routing level. SSL stripping downgrades HTTPS connections to HTTP, removing encryption while presenting a valid HTTPS connection to the server.

Once positioned in the communication path, the attacker can passively monitor traffic to harvest credentials, session tokens, and sensitive data. Active attacks go further — modifying transaction amounts, injecting malicious content into web pages, or redirecting downloads to malware-laden versions. The attacker can maintain separate encrypted sessions with each party, decrypting traffic from one side and re-encrypting it for the other.

Prevention

TLS encryption with proper certificate validation is the primary defense. HSTS (HTTP Strict Transport Security) prevents SSL stripping by forcing browsers to use HTTPS. Certificate pinning ensures applications only accept specific certificates. Mutual TLS authentication verifies both the client and server identities. Network-level protections like Dynamic ARP Inspection and DNSSEC reduce the attack surface for positioning techniques.

Why It Matters

MitM attacks compromise the confidentiality and integrity of all data in transit. In financial applications, they enable transaction manipulation. In authentication flows, they capture credentials in real time. Ensuring communication channels resist interception is fundamental to application security.

Need your application tested? Get in touch.

Need your application tested?

We find these vulnerabilities in real applications every day.

Request an Assessment