File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
csharp/ql/lib/semmle/code/csharp/security/auth Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -166,11 +166,12 @@ predicate hasAuthViaXml(ActionMethod m) {
166
166
)
167
167
}
168
168
169
- /** Holds if the given action has an `Authorize` attribute. */
169
+ /** Holds if the given action has an attribute that indications authorization . */
170
170
predicate 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
+ )
174
175
}
175
176
176
177
/** 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