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 @@ -166,11 +166,12 @@ predicate hasAuthViaXml(ActionMethod m) {
166166 )
167167}
168168
169- /** Holds if the given action has an `Authorize` attribute. */
169+ /** Holds if the given action has an attribute that indications authorization . */
170170predicate hasAuthViaAttribute ( ActionMethod m ) {
171- [ m .getAnAttribute ( ) , m .getDeclaringType ( ) .getAnAttribute ( ) ]
172- .getType ( )
173- .hasQualifiedName ( "Microsoft.AspNetCore.Authorization" , "AuthorizeAttribute" )
171+ exists ( Attribute attr | attr .getType ( ) .getName ( ) .toLowerCase ( ) .matches ( "%auth%" ) |
172+ attr = m .getAnAttribute ( ) or
173+ attr = m .getDeclaringType ( ) .getABaseType * ( ) .getAnAttribute ( )
174+ )
174175}
175176
176177/** Holds if `m` is a method that should have an auth check, but is missing it. */
You can’t perform that action at this time.
0 commit comments