File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
csharp/ql/src/Security Features/CWE-352 Expand file tree Collapse file tree 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 {
2727 AntiForgeryAuthorizationFilter ( ) { this .getOnAuthorizationMethod ( ) = getAValidatingMethod ( ) }
2828}
2929
30+ private Method getAStartedMethod ( ) {
31+ result = any ( WebApplication wa ) .getApplication_StartMethod ( )
32+ or
33+ getAStartedMethod ( ) .calls ( result )
34+ }
35+
3036/**
3137 * Holds if the project has a global anti forgery filter.
3238 */
@@ -38,9 +44,7 @@ predicate hasGlobalAntiForgeryFilter() {
3844 // The filter is an antiforgery filter
3945 addGlobalFilter .getArgumentForName ( "filter" ) .getType ( ) instanceof AntiForgeryAuthorizationFilter and
4046 // The filter is added by the Application_Start() method
41- any ( WebApplication wa )
42- .getApplication_StartMethod ( )
43- .calls * ( addGlobalFilter .getEnclosingCallable ( ) )
47+ getAStartedMethod ( ) = addGlobalFilter .getEnclosingCallable ( )
4448 )
4549}
4650
You can’t perform that action at this time.
0 commit comments