Security best practices for Web application development in Dotnet
Security Best Practices Web Application Development Security Best Practices The following are some of the security best practices that can be followed while developing web applications Cross Site Request Forgery (CSRF) Prevention CSRF is possible if the authenticity is checked only based on the cookie. To avoid this, developers we can adopt the Synchronizer Token Pattern (random “challenge” tokens that are associated with the user’s current session). These challenge tokens are then inserted within the HTML forms and links associated with sensitive server-side operations. When a form is submitted, the form token is also validated along with cookie to safeguard against CSRF attacks. Many mature frameworks already have easy ways to mitigate CSRF. For example dotnet core has the Antiforgery middleware by default in all forms rendered via MVC or razor pages ( https://learn.microsoft.com/en-us/aspnet/core/security/anti-request-forgery?view=aspnetcore-7.0 )