Search code examples
c#asp.net-mvccsrf-protection

How to avoid Cross Site Cross-Site Request Forgery for GET Request


How to avoid Cross-Site Request Forgery for GET method. I have used AntiForgeryToken for all POST methods in my MVC application. Even though it is not needed for Get request, but I want to know the solution to prevent CSRF for HttpGet methods.


Solution

  • Please refer below post. You actually don't need anti-forgery for get request.

    https://security.stackexchange.com/questions/115794/should-i-use-csrf-protection-for-get-requests