A man-in-the-middle (MITM) attack occurs when an attacker positions themselves between two communicating parties, reading or modifying the traffic without either party noticing.
Why it matters
On open Wi-Fi or compromised networks, unencrypted traffic can be read or changed. HTTPS with valid certificate checking prevents most MITM attacks, because the attacker cannot present a trusted certificate for your domain. HSTS stops downgrade attempts to plain HTTP.
Attackers can also use rogue Wi-Fi hotspots, poisoned DNS answers or compromised routers to get into that middle position.
Example
A user on public Wi-Fi visits http://shop.example. A rogue access point rewrites the page to capture the login form. If the site used HTTPS with HSTS, the browser would refuse to load it over HTTP.
Common mistakes
- Clicking through browser certificate warnings.
- Allowing HTTP on a site and relying on users to type https.
- Assuming a VPN protects you from a malicious site itself.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.