When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
For others that want to know more about the remediation for CWE 352 Cross-Site Request Forgery (CSRF) in .NET, Veracode Static Analysis reports this in a number of circumstances, in this case it saw several methods with the HttpPost attribute in a class extending from Microsoft.AspNetCore.Mvc.ControllerBase and did not see one of the following remediations:
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
...
services.AddMvc(options => options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute())) //Will suppress all CSRF issues in Controllers.
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
...
}
Alternatively you can annotate your class as an [ApiController] as described in the Microsoft documentation: https://docs.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-3.1 .
Also please ensure before you review flaws that the application has been compiled per our Compilation Guide for .NET ( https://help.veracode.com/reader/4EKhlLSMHm5jC8P8j3XccQ/UWyzuOKNbFbwQACRLkZVjA ) and ensure you are publishing your project with debug symbols (Debug profile).
Thank you,
Boy Baukema