Does AntiForgeryToken in ASP.NET MVC prevent against all CSRF attacks?
问题 Using AntiForgeryToken requires each request to pass a valid token, so malicious web pages with simple script posting data to my web application won't succeed. But what if a malicious script will first make some simple GET request (by Ajax) in order to download the page containing the antiforgery token in a hidden input field, extracts it, and use it to make a valid POST? Is it possible, or am I missing something? 回答1: Yes, this is all you need to do. As long as you generate a new token on