@@ -49,11 +49,22 @@ private predicate hasGlobalWebMvcAntiforgeryFilter(Compilation compilation) {
4949
5050predicate hasGlobalAspNetMvcAntiForgeryFilter ( Compilation compilation ) {
5151 exists ( MethodCall addGlobalFilter , MethodCall registrationCall |
52- addGlobalFilter .getTarget ( ) =
53- any ( AspNetCore:: MicrosoftAspNetCoreMvcFilterCollection collection ) .getAddMethod ( ) and
54- // The filter is the `AutoValidateAntiforgeryTokenAttribute` filter.
55- addGlobalFilter .getArgument ( 0 ) .getType ( ) instanceof
56- AspNetCore:: AutoValidateAntiforgeryTokenAttribute and
52+ (
53+ // The filter is the `AutoValidateAntiforgeryTokenAttribute` filter.
54+ addGlobalFilter .getTarget ( ) =
55+ any ( AspNetCore:: MicrosoftAspNetCoreMvcFilterCollection collection ) .getAddMethod ( ) and
56+ (
57+ addGlobalFilter .getArgument ( 0 ) .getType ( ) instanceof
58+ AspNetCore:: AutoValidateAntiforgeryTokenAttribute or
59+ addGlobalFilter .getArgument ( 0 ) .( TypeofExpr ) .getTypeAccess ( ) .getTarget ( ) instanceof
60+ AspNetCore:: AutoValidateAntiforgeryTokenAttribute
61+ )
62+ or
63+ addGlobalFilter .getTarget ( ) .getUnboundDeclaration ( ) =
64+ any ( AspNetCore:: MicrosoftAspNetCoreMvcFilterCollection collection ) .getAddMethod ( ) and
65+ addGlobalFilter .getTarget ( ) .( ConstructedGeneric ) .getTypeArgument ( 0 ) instanceof
66+ AspNetCore:: AutoValidateAntiforgeryTokenAttribute
67+ ) and
5768 // The filter is added in an ASP.NET Core registration call, which is provided as a lambda argument
5869 // to the Mvc registration method.
5970 registrationCall .getTarget ( ) instanceof AspNetCore:: MicrosoftAspNetCoreMvcRegistration and
0 commit comments