File tree Expand file tree Collapse file tree
csharp/ql/lib/semmle/code/csharp/security/auth Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ private predicate hasAuthorizeAttribute(ActionMethod m) {
4444 exists ( Attribute attr |
4545 attr .getType ( )
4646 .getABaseType * ( )
47- .hasQualifiedName ( "Microsoft.AspNetCore.Authorization" , "AuthorizeAttribute" )
47+ .hasQualifiedName ( [
48+ "Microsoft.AspNetCore.Authorization" , "System.Web.Mvc" , "System.Web.Http"
49+ ] , "AuthorizeAttribute" )
4850 |
49- attr = m .getAnAttribute ( ) or
51+ attr = m .getOverridee * ( ) . getAnAttribute ( ) or
5052 attr = m .getDeclaringType ( ) .getABaseType * ( ) .getAnAttribute ( )
5153 )
5254}
@@ -56,14 +58,16 @@ private predicate hasAllowAnonymousAttribute(ActionMethod m) {
5658 exists ( Attribute attr |
5759 attr .getType ( )
5860 .getABaseType * ( )
59- .hasQualifiedName ( "Microsoft.AspNetCore.Authorization" , "AllowAnonymousAttribute" )
61+ .hasQualifiedName ( [
62+ "Microsoft.AspNetCore.Authorization" , "System.Web.Mvc" , "System.Web.Http"
63+ ] , "AllowAnonymousAttribute" )
6064 |
61- attr = m .getAnAttribute ( ) or
65+ attr = m .getOverridee * ( ) . getAnAttribute ( ) or
6266 attr = m .getDeclaringType ( ) .getABaseType * ( ) .getAnAttribute ( )
6367 )
6468}
6569
66- /** Hols if `m` is authorized via an `Authorize` attribute */
70+ /** Holds if `m` is authorized via an `Authorize` attribute */
6771private predicate isAuthorizedViaAttribute ( ActionMethod m ) {
6872 hasAuthorizeAttribute ( m ) and
6973 not hasAllowAnonymousAttribute ( m )
You can’t perform that action at this time.
0 commit comments