File tree Expand file tree Collapse file tree
csharp/ql/lib/semmle/code/csharp/frameworks/microsoft Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,14 @@ class MicrosoftAspNetCoreMvcNonActionAttribute extends MicrosoftAspNetCoreMvcAtt
6262 MicrosoftAspNetCoreMvcNonActionAttribute ( ) { this .getType ( ) .hasName ( "NonActionAttribute" ) }
6363}
6464
65+ class MicrosoftAspNetCoreMvcNonControllerAttribute extends MicrosoftAspNetCoreMvcAttribute {
66+ MicrosoftAspNetCoreMvcNonControllerAttribute ( ) { getType ( ) .hasName ( "NonControllerAttribute" ) }
67+ }
68+
69+ class MicrosoftAspNetCoreMvcControllerAttribute extends MicrosoftAspNetCoreMvcAttribute {
70+ MicrosoftAspNetCoreMvcControllerAttribute ( ) { getType ( ) .hasName ( "ControllerAttribute" ) }
71+ }
72+
6573/** The `Microsoft.AspNetCore.Antiforgery` namespace. */
6674class MicrosoftAspNetCoreAntiforgeryNamespace extends Namespace {
6775 MicrosoftAspNetCoreAntiforgeryNamespace ( ) {
@@ -185,7 +193,12 @@ class MicrosoftAspNetCoreMvcControllerBaseClass extends Class {
185193/** A subtype of `Microsoft.AspNetCore.Mvc.Controller` or `Microsoft.AspNetCore.Mvc.ControllerBase`. */
186194class MicrosoftAspNetCoreMvcController extends Class {
187195 MicrosoftAspNetCoreMvcController ( ) {
188- this .getABaseType * ( ) instanceof MicrosoftAspNetCoreMvcControllerBaseClass
196+ (
197+ getABaseType * ( ) instanceof MicrosoftAspNetCoreMvcControllerBaseClass or
198+ getABaseType * ( ) .hasName ( "%Controller" ) or
199+ getABaseType * ( ) .getAnAttribute ( ) instanceof MicrosoftAspNetCoreMvcControllerAttribute
200+ ) and
201+ not getABaseType * ( ) .getAnAttribute ( ) instanceof MicrosoftAspNetCoreMvcNonControllerAttribute
189202 }
190203
191204 /** Gets an action method for this controller. */
You can’t perform that action at this time.
0 commit comments