Skip to content

Commit 78e1879

Browse files
committed
Use more flowTo.
1 parent dc6d3fe commit 78e1879

File tree

18 files changed

+19
-19
lines changed

18 files changed

+19
-19
lines changed

cpp/ql/src/Security/CWE/CWE-020/ExternalAPIs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ExternalAPIsSpecific
1010

1111
/** A node representing untrusted data being passed to an external API. */
1212
class UntrustedExternalApiDataNode extends ExternalApiDataNode {
13-
UntrustedExternalApiDataNode() { UntrustedDataToExternalApiFlow::flow(_, this) }
13+
UntrustedExternalApiDataNode() { UntrustedDataToExternalApiFlow::flowTo(this) }
1414

1515
/** Gets a source of untrusted data which is passed to this external API data node. */
1616
DataFlow::Node getAnUntrustedSource() { UntrustedDataToExternalApiFlow::flow(result, this) }

cpp/ql/src/Security/CWE/CWE-020/ir/ExternalAPIs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ExternalAPIsSpecific
1010

1111
/** A node representing untrusted data being passed to an external API. */
1212
class UntrustedExternalApiDataNode extends ExternalApiDataNode {
13-
UntrustedExternalApiDataNode() { UntrustedDataToExternalApiFlow::flow(_, this) }
13+
UntrustedExternalApiDataNode() { UntrustedDataToExternalApiFlow::flowTo(this) }
1414

1515
/** Gets a source of untrusted data which is passed to this external API data node. */
1616
DataFlow::Node getAnUntrustedSource() { UntrustedDataToExternalApiFlow::flow(result, this) }

csharp/ql/lib/semmle/code/csharp/security/dataflow/ExternalAPIsQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module RemoteSourceToExternalApi = TaintTracking::Global<RemoteSourceToExternalA
8585

8686
/** A node representing untrusted data being passed to an external API. */
8787
class UntrustedExternalApiDataNode extends ExternalApiDataNode {
88-
UntrustedExternalApiDataNode() { RemoteSourceToExternalApi::flow(_, this) }
88+
UntrustedExternalApiDataNode() { RemoteSourceToExternalApi::flowTo(this) }
8989

9090
/** Gets a source of untrusted data which is passed to this external API data node. */
9191
DataFlow::Node getAnUntrustedSource() { RemoteSourceToExternalApi::flow(result, this) }

csharp/ql/lib/semmle/code/csharp/security/dataflow/ReDoSQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ExponentialRegexSink extends DataFlow::ExprNode, Sink {
9191
ExponentialRegexSink() {
9292
exists(RegexOperation regexOperation |
9393
// Exponential regex flows to the pattern argument
94-
ExponentialRegexDataFlow::flow(_, DataFlow::exprNode(regexOperation.getPattern()))
94+
ExponentialRegexDataFlow::flowToExpr(regexOperation.getPattern())
9595
|
9696
// This is used as an input for this pattern
9797
this.getExpr() = regexOperation.getInput() and

csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ where
5353
// JsonConvert static method call, but with additional unsafe typename tracking
5454
exists(DataFlow::Node settingsCallArg |
5555
JsonConvertTracking::flowPath(userInput.asPathNode3(), deserializeCallArg.asPathNode3()) and
56-
TypeNameTracking::flow(_, settingsCallArg) and
56+
TypeNameTracking::flowTo(settingsCallArg) and
5757
sameParent(deserializeCallArg.getNode(), settingsCallArg)
5858
)
5959
select deserializeCallArg, userInput, deserializeCallArg, "$@ flows to unsafe deserializer.",

go/ql/lib/semmle/go/security/AllocationSizeOverflow.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module AllocationSizeOverflow {
2727
private module FindLargeLensFlow = TaintTracking::Global<FindLargeLensConfig>;
2828

2929
private DataFlow::CallNode getALargeLenCall() {
30-
exists(DataFlow::Node lenArg | FindLargeLensFlow::flow(_, lenArg) |
30+
exists(DataFlow::Node lenArg | FindLargeLensFlow::flowTo(lenArg) |
3131
result.getArgument(0) = lenArg
3232
)
3333
}

go/ql/lib/semmle/go/security/ExternalAPIs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ module UntrustedDataToUnknownExternalApiFlow =
211211

212212
/** A node representing untrusted data being passed to an external API. */
213213
class UntrustedExternalApiDataNode extends ExternalApiDataNode {
214-
UntrustedExternalApiDataNode() { UntrustedDataToExternalApiFlow::flow(_, this) }
214+
UntrustedExternalApiDataNode() { UntrustedDataToExternalApiFlow::flowTo(this) }
215215

216216
/** Gets a source of untrusted data which is passed to this external API data node. */
217217
DataFlow::Node getAnUntrustedSource() { UntrustedDataToExternalApiFlow::flow(result, this) }

go/ql/src/Security/CWE-601/OpenUrlRedirect.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ where
2121
OpenUrlRedirect::Flow::flowPath(source, sink) and
2222
// this excludes flow from safe parts of request URLs, for example the full URL when the
2323
// doing a redirect from `http://<path>` to `https://<path>`
24-
not SafeUrlFlow::Flow::flow(_, sink.getNode())
24+
not SafeUrlFlow::Flow::flowTo(sink.getNode())
2525
select sink.getNode(), source, sink, "This path to an untrusted URL redirection depends on a $@.",
2626
source.getNode(), "user-provided value"

go/ql/src/Security/CWE-918/RequestForgery.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ where
2121
RequestForgery::Flow::flowPath(source, sink) and
2222
request = sink.getNode().(RequestForgery::Sink).getARequest() and
2323
// this excludes flow from safe parts of request URLs, for example the full URL
24-
not SafeUrlFlow::Flow::flow(_, sink.getNode())
24+
not SafeUrlFlow::Flow::flowTo(sink.getNode())
2525
select request, source, sink, "The $@ of this request depends on a $@.", sink.getNode(),
2626
sink.getNode().(RequestForgery::Sink).getKind(), source, "user-provided value"

javascript/ql/lib/semmle/javascript/security/dataflow/ExternalAPIUsedWithUntrustedDataQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ExternalApiDataNode extends DataFlow::Node instanceof Sink { }
9797

9898
/** A node representing untrusted data being passed to an external API. */
9999
class UntrustedExternalApiDataNode extends ExternalApiDataNode {
100-
UntrustedExternalApiDataNode() { ExternalAPIUsedWithUntrustedDataFlow::flow(_, this) }
100+
UntrustedExternalApiDataNode() { ExternalAPIUsedWithUntrustedDataFlow::flowTo(this) }
101101

102102
/** Gets a source of untrusted data which is passed to this external API data node. */
103103
DataFlow::Node getAnUntrustedSource() { ExternalAPIUsedWithUntrustedDataFlow::flow(result, this) }
@@ -110,7 +110,7 @@ private newtype TExternalApi =
110110
/** An external API sink with `name`. */
111111
MkExternalApiNode(string name) {
112112
exists(Sink sink |
113-
ExternalAPIUsedWithUntrustedDataFlow::flow(_, sink) and
113+
ExternalAPIUsedWithUntrustedDataFlow::flowTo(sink) and
114114
name = sink.getApiName()
115115
)
116116
}

0 commit comments

Comments
 (0)