CSRF
CSRF = Cross-site Request Forgery
A hacker site sends requests to your server posing itself as a valid authenticated user from another tab in the same browser session where user is logged in.
To avoid CSRF, ASP.net MVC uses AntiForgeryToken
that can be added to a form which user submits to send request. This would create a unique session token and passed as a hidden field's value in the form.
The MVC controller action that processes the request can be decorated with [ValidateAntiForgeryToken(salt="someSecretKey1")]
decorator:
Last updated
Was this helpful?