Skip to content

Commit 13997ca

Browse files
committed
feedback from code review
1 parent 3e889c3 commit 13997ca

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,19 @@ module Sources {
8383

8484
/** Flow Sinks for the ServiceStack framework */
8585
module Sinks {
86-
private import semmle.code.csharp.security.dataflow.flowsinks.Remote
86+
private import semmle.code.csharp.security.dataflow.flowsinks.ExternalLocationSink
8787

8888
/** RemoteFlow sinks for service stack */
89-
class ServiceStackRemoteRequestParameter extends RemoteFlowSink {
89+
class ServiceStackRemoteRequestParameter extends ExternalLocationSink {
9090
ServiceStackRemoteRequestParameter() {
9191
exists(MethodCall mc |
92-
mc.getTarget().hasQualifiedName("ServiceStack.IRestClient.Get") and
93-
mc.getArgument(0) = this.asExpr()
92+
mc.getTarget().getQualifiedName() in [
93+
"ServiceStack.IRestClient.Get", "ServiceStack.IRestClient.Put",
94+
"ServiceStack.IRestClient.Post", "ServiceStack.IRestClient.Delete",
95+
"ServiceStack.IRestClient.Post", "ServiceStack.IRestClient.Put",
96+
"ServiceStack.IRestClient.Patch", "ServiceStack.IRestClient.Send"
97+
] and
98+
this.asExpr() = mc.getAnArgument()
9499
)
95100
}
96101
}

csharp/ql/src/semmle/code/csharp/security/dataflow/flowsinks/ExternalLocationSink.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import csharp
66
private import Remote
77
private import semmle.code.csharp.commons.Loggers
88
private import semmle.code.csharp.frameworks.system.Web
9-
9+
private import semmle.code.csharp.frameworks.ServiceStack::Sinks
1010
/**
1111
* An external location sink.
1212
*

csharp/ql/src/semmle/code/csharp/security/dataflow/flowsinks/Remote.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ private import ExternalLocationSink
88
private import Html
99
private import semmle.code.csharp.security.dataflow.XSS
1010
private import semmle.code.csharp.frameworks.system.web.UI
11-
import semmle.code.csharp.frameworks.ServiceStack::Sinks
11+
private import semmle.code.csharp.frameworks.ServiceStack::Sinks
1212

1313
/** A data flow sink of remote user output. */
1414
abstract class RemoteFlowSink extends DataFlow::Node { }

0 commit comments

Comments
 (0)