File tree Expand file tree Collapse file tree
lib/semmle/code/csharp/frameworks/microsoft
src/Security Features/CWE-352 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,8 +173,8 @@ class MicrosoftAspNetCoreMvcFilterCollection extends Class {
173173
174174 /** Gets an `Add` method. */
175175 Method getAddMethod ( ) {
176- result = this .getAMethod ( "Add" ) or
177- result = this .getABaseType ( ) .getAMethod ( "Add" )
176+ result = this .getAMethod ( [ "Add" , "Add`1" ] ) or
177+ result = this .getABaseType ( ) .getAMethod ( [ "Add" , "Add`1" ] )
178178 }
179179}
180180
Original file line number Diff line number Diff line change @@ -49,11 +49,15 @@ private predicate hasGlobalWebMvcAntiforgeryFilter(Compilation compilation) {
4949
5050predicate hasGlobalAspNetMvcAntiForgeryFilter ( Compilation compilation ) {
5151 exists ( MethodCall addGlobalFilter , MethodCall registrationCall |
52- addGlobalFilter .getTarget ( ) =
52+ addGlobalFilter .getTarget ( ) . getUnboundDeclaration ( ) =
5353 any ( AspNetCore:: MicrosoftAspNetCoreMvcFilterCollection collection ) .getAddMethod ( ) and
5454 // The filter is the `AutoValidateAntiforgeryTokenAttribute` filter.
55- addGlobalFilter .getArgument ( 0 ) .getType ( ) instanceof
56- AspNetCore:: AutoValidateAntiforgeryTokenAttribute and
55+ (
56+ addGlobalFilter .getArgument ( 0 ) .getType ( ) instanceof
57+ AspNetCore:: AutoValidateAntiforgeryTokenAttribute or
58+ addGlobalFilter .getTarget ( ) .( ConstructedGeneric ) .getTypeArgument ( 0 ) instanceof
59+ AspNetCore:: AutoValidateAntiforgeryTokenAttribute
60+ ) and
5761 // The filter is added in an ASP.NET Core registration call, which is provided as a lambda argument
5862 // to the Mvc registration method.
5963 registrationCall .getTarget ( ) instanceof AspNetCore:: MicrosoftAspNetCoreMvcRegistration and
You can’t perform that action at this time.
0 commit comments