Cross-Site Request Forgery (CSRF)

Cross-Site Request Forgery (CSRF) is an attack that takes advantage of users who are already authenticated in a web application by making them perform unwanted actions in that application. An attacker can trick the users of a web application by sending a link via email which executes a hidden action. CSRF attacks are not useful for data theft, since it targets state-changing requests meaning the attacker cannot see the response of the forged request. But the attacker make the victim unknowingly perform various actions like changing their login information, transferring funds etc. How does it work? To explain how a CSRF attack is carried out, let us take a look at a simple example. Bob wants to transfer Rs.7000 to Alice through HNB bank's online transaction portal. To do so Bob authenticates to the bank's website using his credentials. Eve is the attacker in this scenario and she plans on using a CSRF attack to get money transacted to her from Bob. To do this successf...