You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A newer pattern exists for auto validating CSRF tokens in .NET Core to protect all endpoints through global filter configuration. Is there any pattern for detecting this attribute is globally applied and disable SEC0019? Potentially here SEC0019 could apply to the use of the ignore attribute.
The text was updated successfully, but these errors were encountered:
felickz
changed the title
Globally disable SG0016 Controller method is vulnerable to CSRF when using AutoValidateAntiforgeryTokenAttribute in .NET Core
remove me!
Oct 11, 2017
A newer pattern exists for auto validating CSRF tokens in .NET Core to protect all endpoints through global filter configuration. Is there any pattern for detecting this attribute is globally applied and disable SEC0019? Potentially here SEC0019 could apply to the use of the ignore attribute.
Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
AutoValidateAntiforgeryTokenAttribute can be applied as a global filter to trigger validation of antiforgery tokens by default for an application.
Also, we should call out the usage of IgnoreAntiforgeryTokenAttribute here.
Blog explaining the topic: https://andrewlock.net/automatically-validating-anti-forgery-tokens-in-asp-net-core-with-the-autovalidateantiforgerytokenattribute/
This would be dependent on .NET Core support #36
The text was updated successfully, but these errors were encountered: