Abdu Taviq

MITM, CSRF, and XSS: How to Prevent Famous Cyber Attacks

- 2 min Read

Photo by Nahel Abdul Hadi
Photo by Nahel Abdul Hadi

These are some of the very famous attacks that could happen to any website. We will cover a summary of these attacks and how you can protect against them.

MITM

Man-In-The-Middle. It happens when an attacker is between the client and the server and listening to all their communications.

Famously happens when the client has malicious software like cracks and trojan code or downloads an unknown application sent via Whatsapp or Email.

These attacks can steal sensitive information or alter the request data.

To protect against it:

CSRF

Cross-Site Request Forgery. It happens when an attacker phishing website shows an identical design of the website and sends requests to the server on behave of the client. The server won’t have an idea that this the attacker.

To solve this:

XSS

Cross-Site Scripting. It happens when a script is injected into the client UI and it gains access to read sensitive information or send requests on behave of the client.

It can happen if the client has an unsanitized input control that prints text things directly to the UI or sends requests to the server without sanitization.

An example can be a contact form that could run a script on the backend and hijack admin data or prevent the user from even logging in. (This one happened to one of my clients)

To Solve this: