
ASP.NET Core 5 Secure Coding Cookbook
By :

Another complementing strategy that a developer can implement in processing input is to remove or replace unwanted characters from the data. Your application might expect some free-form text or HTML formatted input, and to avoid attacks that will take advantage of this vector, you must perform sanitization.
You can write your own methods for sanitizing and, similar to input validation, implement either a whitelisting or blacklisting approach for modifying input.
In this recipe, you will learn how to write your own code for sanitizing input.
Using Visual Studio Code, open the sample Online Banking app folder at \Chapter01\input-sanitization\before\OnlineBankingApp
.
Let's take a look at the steps for this recipe:
code .
Models/FundTransfer.cs
file and add a reference to the System.Text.RegularExpressions...