File tree 1 file changed +7
-3
lines changed
csharp/ql/src/Security Features/CWE-352
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ class AntiForgeryAuthorizationFilter extends AuthorizationFilter {
27
27
AntiForgeryAuthorizationFilter ( ) { this .getOnAuthorizationMethod ( ) = getAValidatingMethod ( ) }
28
28
}
29
29
30
+ private Method getAStartedMethod ( ) {
31
+ result = any ( WebApplication wa ) .getApplication_StartMethod ( )
32
+ or
33
+ getAStartedMethod ( ) .calls ( result )
34
+ }
35
+
30
36
/**
31
37
* Holds if the project has a global anti forgery filter.
32
38
*/
@@ -38,9 +44,7 @@ predicate hasGlobalAntiForgeryFilter() {
38
44
// The filter is an antiforgery filter
39
45
addGlobalFilter .getArgumentForName ( "filter" ) .getType ( ) instanceof AntiForgeryAuthorizationFilter and
40
46
// The filter is added by the Application_Start() method
41
- any ( WebApplication wa )
42
- .getApplication_StartMethod ( )
43
- .calls * ( addGlobalFilter .getEnclosingCallable ( ) )
47
+ getAStartedMethod ( ) = addGlobalFilter .getEnclosingCallable ( )
44
48
)
45
49
}
46
50
You can’t perform that action at this time.
0 commit comments