I understand Cross-Site Request Forgery and found numerous blogs,articles on web to handle it in asp.net mvc,but have not got a decent links,helpful solutions to deal with CSRF attacks in asp.net web applications.I have ran a security tool on my website,and its reporting the cross site request forgery and showing the risk
It is possible to steal or manipulate customer session and cookies, which might be used to impersonate a legitimate user, allowing the hacker to view or alter user records, and to perform transactions as that user
My question is how to deal with CSRF attacks in ASP.NET web applications?
If you look at the second link you posted you see the logic of the
Html.AntiForgeryToken()
validation in MVC:Shouldn't be that hard to do the same in your web-forms app.
See THIS answer for a possible solution.
Is there any solution for the same in Asp.net Web form application which will handle in
Global.asax
.In MVC it becomes very simple but if old application is simple web form and want to prevent from such attack at global level then what will be the solution.
The ViewState mechanism can be used to protect against CSRF in a web forms app.
Also regarding your other question on CSRF:
A CSRF attack usually doesn't allow an attacker to view anything, only to make requests on behalf of the logged in user. However, if there was a change password option that doesn't require the current password to be submitted, the attacker might be able to call this function using the victim's session for the attacker to then later log in directly as the victim user.