Man-in-the-Middle Attack
A man-in-the-middle attack is a type of cyberattack where an attacker secretly positions themselves between two parties who are communicating, such as a user and a website. The attacker can eavesdrop on the conversation, steal sensitive information, or alter the data being exchanged, typically without either party realizing the communication has been compromised.
A man-in-the-middle (MITM) attack is a network-layer or application-layer attack in which an adversary inserts themselves into the communication path between two entities in order to intercept, relay, and potentially alter data in transit. Attackers typically exploit weak or improperly implemented web-based protocols, insufficient certificate validation, or compromised network infrastructure to gain this position. MITM attacks can target communications between a user and an application, between two services, or between any two networked endpoints. Because the attacker relays traffic between the legitimate parties, both sides may believe they are communicating directly with each other. Defenses typically include enforcing strong transport-layer encryption (such as TLS with proper certificate pinning), mutual authentication, and integrity verification of transmitted data, though detection can be difficult in environments where certificate trust chains are not rigorously validated.
Why it matters
Man-in-the-middle attacks pose a serious threat to application security because they undermine the fundamental trust assumption that two communicating parties are exchanging data privately and without tampering. When an attacker successfully positions themselves on the communication path, they can intercept credentials, session tokens, API keys, and other sensitive data in transit. This is particularly dangerous in application environments where services communicate over networks that may not enforce strong transport-layer encryption, or where certificate validation is improperly implemented. The attack can compromise not only end-user sessions but also service-to-service communications within distributed architectures.
Who it's relevant to
Inside MITM
Common questions
Answers to the questions practitioners most commonly ask about MITM.