@@ -12,7 +12,7 @@ private import semmle.code.csharp.dataflow.ExternalFlow
12
12
private class ServiceClass extends Class {
13
13
ServiceClass ( ) {
14
14
this .getBaseClass + ( ) .hasQualifiedName ( "ServiceStack" , "Service" ) or
15
- this .getABaseInterface + ( ) .hasQualifiedName ( "ServiceStack" , "IService" )
15
+ this .getABaseType * ( ) . getABaseInterface ( ) .hasQualifiedName ( "ServiceStack" , "IService" )
16
16
}
17
17
18
18
/** Get a method that handles incoming requests */
@@ -26,7 +26,9 @@ private class ServiceClass extends Class {
26
26
27
27
/** Top-level Request DTO types */
28
28
private class RequestDTO extends Class {
29
- RequestDTO ( ) { this .getABaseInterface + ( ) .hasQualifiedName ( "ServiceStack" , "IReturn" ) }
29
+ RequestDTO ( ) {
30
+ this .getABaseType * ( ) .getABaseInterface ( ) .hasQualifiedName ( "ServiceStack" , "IReturn" )
31
+ }
30
32
}
31
33
32
34
/** Flow sources for the ServiceStack framework */
@@ -308,14 +310,7 @@ module XSS {
308
310
exists ( ServiceClass service , Method m , Expr e |
309
311
service .getARequestMethod ( ) = m and
310
312
this .asExpr ( ) = e and
311
- (
312
- exists ( ReturnStmt r |
313
- e = r .getExpr ( ) and
314
- r .getEnclosingCallable ( ) = m
315
- )
316
- or
317
- e = m .getExpressionBody ( )
318
- ) and
313
+ m .canReturn ( e ) and
319
314
(
320
315
e .getType ( ) instanceof StringType or
321
316
e .getType ( ) .hasQualifiedName ( "ServiceStack" , "HttpResult" )
0 commit comments