Skip to content

Commit 05dd3fa

Browse files
committed
Adjust review findings
1 parent abe6c90 commit 05dd3fa

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

csharp/ql/lib/semmle/code/csharp/frameworks/ServiceStack.qll

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private import semmle.code.csharp.dataflow.ExternalFlow
1212
private class ServiceClass extends Class {
1313
ServiceClass() {
1414
this.getBaseClass+().hasQualifiedName("ServiceStack", "Service") or
15-
this.getABaseInterface+().hasQualifiedName("ServiceStack", "IService")
15+
this.getABaseType*().getABaseInterface().hasQualifiedName("ServiceStack", "IService")
1616
}
1717

1818
/** Get a method that handles incoming requests */
@@ -26,7 +26,9 @@ private class ServiceClass extends Class {
2626

2727
/** Top-level Request DTO types */
2828
private class RequestDTO extends Class {
29-
RequestDTO() { this.getABaseInterface+().hasQualifiedName("ServiceStack", "IReturn") }
29+
RequestDTO() {
30+
this.getABaseType*().getABaseInterface().hasQualifiedName("ServiceStack", "IReturn")
31+
}
3032
}
3133

3234
/** Flow sources for the ServiceStack framework */
@@ -308,14 +310,7 @@ module XSS {
308310
exists(ServiceClass service, Method m, Expr e |
309311
service.getARequestMethod() = m and
310312
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
319314
(
320315
e.getType() instanceof StringType or
321316
e.getType().hasQualifiedName("ServiceStack", "HttpResult")

0 commit comments

Comments
 (0)