Fixing the disabled anti-Cross-Site Request Forgery protection
There is an inherent trust between the browser and web server that adversaries can often abuse. Users of web applications, typically issued with an authenticated session by the ASP.NET Core web application, are tricked by perpetrators into performing an unintentional action by simply visiting or interacting with a malicious website. This method of attack abuses the already established authenticated state of the user by making the browser send a specially crafted request from a malicious website. This Cross-Site Request Forgery (CSRF) vulnerability prompts us to review our code and enable request validation, which we will learn about in this recipe.
Getting ready
For the recipes in this chapter, we will need a sample Online Banking app.
Open the command shell and download the sample Online Banking app by cloning the ASP.NET Secure Coding Cookbook repository, as follows:
git clone https://github.com/PacktPublishing...