Security 3 mins read

What is a Man-In-The-Middle Attack and How does HSTS Header Help Prevent it?

Unleash the power of HSTS and safeguard your online communication from potential threats.
Neelkanth Kaushik

The Man-in-the-Middle attack is one of the oldest types of cyber threats. In this attack then attackers intercept an existing conversation or data transfer, either by eavesdropping or by pretending to be a legitimate participant. To the victim, it will appear as though a standard exchange of information is underway — but by inserting themselves into the “middle” of the conversation or data transfer, the attacker can quietly hijack information.


The goal of a MITM attack is to retrieve confidential data such as bank account details, credit card numbers, or login credentials


The man-in-the-middle attack process has a two-stage approach: interception and decryption.



During the interception step, the cybercriminal attempts to put themselves between the client and server—typically a user and web application.


After targets are determined and fall for the bait, cybercriminals use data capture tools to transmit any login information and web activity back to them and decrypt it into readable text. During the decryption phase, the intercepted data becomes usable to the criminal.


Types of Man-in-the-Middle Attacks :


The main types of MITM attacks include:

  • IP Spoofing: A cybercriminal alters the Internet Protocol (IP) address of a website, email address, or device and spoofs the entity—making the user think they’re interacting with a trusted source when they’re really passing information to a malicious actor.
  • DNS Spoofing: For Domain Name System (DNS) spoofing, a spammer creates and operates a fake website that the user is familiar with and routes them to it to acquire user credentials or other information.
  • HTTPS Spoofing: A user assumes a website has the HyperText Transfer Protocol Secure (HTTPS), meaning they have their computer data encrypted to the website host. However, they were secretly redirected to a non-secure HTTP website, allowing criminals to track interactions and steal information.
  • Email Hijacking: Attackers secretly gain access to a banking or credit card company’s email accounts to monitor transactions and steal information. They might also use the email account or a spoofed email address slightly different from the actual one to provide false instructions to the customers, such as wiring money into a new checking account.
  • Wi-Fi Eavesdropping: Spammers create public Wi-Fi networks or hotspots that appear to be a nearby business or other trusted sources. Users who connect then have all their activity and sensitive data intercepted.
  • SSL Hijacking: An extension of HTTPS spoofing, hijacking the Secure Sockets Layers (SSL) is when a hacker takes this protocol responsible for encrypting HTTPS connections and intercepts user data traveling between them and the server they’re connecting to.
  • Session Hijacking: Commonly known as browser cookie theft, an attacker will steal information stored on web browser cookies, such as saved passwords.


How HSTS Header Can Help Reduce the Risk of a MITM Attack?


The HSTS Policy helps protect web application users against some passive (eavesdropping) and active network attacks.[10] A man-in-the-middle attacker has a greatly reduced ability to intercept requests and responses between a user and a web application server while the user’s browser has HSTS Policy in effect for that web application.


The HSTS header stops MitM attacks by instructing the browser to always send HTTPS (as opposed to HTTP) requests to the domain until the policy expires. So a browser that respects the header would send a request to even if the user clicked a link to


Scan your website using our ThinkScan tool to know if your website is having HSTS header configured or not.

Need help with security
for your digital platform?

Get to know how application security experts help you keep your digital platforms safe.
Schedule a call with our application security experts.

unthinkable ideas