Cross site request forgery issue has been reportd by veracode scan on our web api and mvc applications.
They suggested to generate nonce value and store it in a hidden field to compare.
Kindly advise on implementation.
Hi tsakumar81,
Use the AntiForgeryToken function of the HTML Helper class to prevent Cross site request forgery.
@Html.AntiForgeryToken()
and decorate the Action Method with ValidateAntiForgeryToken attribute.
For more details refer below article.
Prevent Cross-Site Request Forgery Attack in ASP.Net MVC
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.