
ASP.NET Core 5 Secure Coding Cookbook
By :

A user can be tricked into clicking a link generated from your ASP.NET Core web application, but this can eventually redirect them to a malicious website. Open redirection can happen when a user-controlled parameter determines that the URL to redirect to has no validation or whitelisting. In this recipe, we will remediate the risk of open redirect attacks in code by utilizing safer redirect methods.
First, let's take a look at how an open redirect vulnerability is exploited.
We will use the Online Banking app we used in the previous recipe. Using VS Code, open the sample Online Banking app folder at \Chapter06\unvalidated-redirect\before\OnlineBankingApp\
.
You can also perform the steps in this folder for the Fixing open redirect vulnerability recipe.
Here are the steps: