Skip to content

Commit 1bf4dd9

Browse files
committed
Update to DataFlow::Global
1 parent 2eea34d commit 1bf4dd9

12 files changed

+19
-19
lines changed

java/ql/lib/semmle/code/java/security/AndroidCertificatePinningQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private module UntrustedUrlConfig implements DataFlow::ConfigSig {
118118
predicate isSink(DataFlow::Node node) { node instanceof MissingPinningSink }
119119
}
120120

121-
private module UntrustedUrlFlow = TaintTracking::Make<UntrustedUrlConfig>;
121+
private module UntrustedUrlFlow = TaintTracking::Global<UntrustedUrlConfig>;
122122

123123
/** Holds if `node` is a network communication call for which certificate pinning is not implemented. */
124124
predicate missingPinning(DataFlow::Node node, string domain) {
@@ -128,7 +128,7 @@ predicate missingPinning(DataFlow::Node node, string domain) {
128128
not trustedDomain(_) and domain = ""
129129
or
130130
exists(DataFlow::Node src |
131-
UntrustedUrlFlow::hasFlow(src, node) and
131+
UntrustedUrlFlow::flow(src, node) and
132132
domain = getDomain(src.asExpr())
133133
)
134134
)

java/ql/lib/semmle/code/java/security/AndroidIntentRedirectionQuery.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ module IntentRedirectionConfig implements DataFlow::ConfigSig {
4242
}
4343

4444
/** Tracks the flow of tainted Intents being used to start Android components. */
45-
module IntentRedirectionFlow = TaintTracking::Make<IntentRedirectionConfig>;
45+
module IntentRedirectionFlow = TaintTracking::Global<IntentRedirectionConfig>;
4646

4747
/**
4848
* A sanitizer for sinks that receive the original incoming Intent,
4949
* since its component cannot be arbitrarily set.
5050
*/
5151
private class OriginalIntentSanitizer extends IntentRedirectionSanitizer {
52-
OriginalIntentSanitizer() { SameIntentBeingRelaunchedFlow::hasFlowTo(this) }
52+
OriginalIntentSanitizer() { SameIntentBeingRelaunchedFlow::flowTo(this) }
5353
}
5454

5555
/**
@@ -77,14 +77,14 @@ private module SameIntentBeingRelaunchedConfig implements DataFlow::ConfigSig {
7777
}
7878
}
7979

80-
private module SameIntentBeingRelaunchedFlow = DataFlow::Make<SameIntentBeingRelaunchedConfig>;
80+
private module SameIntentBeingRelaunchedFlow = DataFlow::Global<SameIntentBeingRelaunchedConfig>;
8181

8282
/** An `Intent` with a tainted component. */
8383
private class IntentWithTaintedComponent extends DataFlow::Node {
8484
IntentWithTaintedComponent() {
8585
exists(IntentSetComponent setExpr |
8686
setExpr.getQualifier() = this.asExpr() and
87-
TaintedIntentComponentFlow::hasFlowTo(DataFlow::exprNode(setExpr.getSink()))
87+
TaintedIntentComponentFlow::flowTo(DataFlow::exprNode(setExpr.getSink()))
8888
)
8989
}
9090
}
@@ -100,7 +100,7 @@ private module TaintedIntentComponentConfig implements DataFlow::ConfigSig {
100100
}
101101
}
102102

103-
private module TaintedIntentComponentFlow = TaintTracking::Make<TaintedIntentComponentConfig>;
103+
private module TaintedIntentComponentFlow = TaintTracking::Global<TaintedIntentComponentConfig>;
104104

105105
/** A call to a method that changes the component of an `Intent`. */
106106
private class IntentSetComponent extends MethodAccess {

java/ql/lib/semmle/code/java/security/ImproperIntentVerificationQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ private module VerifiedIntentConfig implements DataFlow::ConfigSig {
2727
}
2828
}
2929

30-
private module VerifiedIntentFlow = DataFlow::Make<VerifiedIntentConfig>;
30+
private module VerifiedIntentFlow = DataFlow::Global<VerifiedIntentConfig>;
3131

3232
/** An `onReceive` method that doesn't verify the action of the intent it receives. */
3333
private class UnverifiedOnReceiveMethod extends OnReceiveMethod {
3434
UnverifiedOnReceiveMethod() {
35-
not VerifiedIntentFlow::hasFlow(DataFlow::parameterNode(this.getIntentParameter()), _)
35+
not VerifiedIntentFlow::flow(DataFlow::parameterNode(this.getIntentParameter()), _)
3636
}
3737
}
3838

java/ql/lib/semmle/code/java/security/SensitiveKeyboardCacheQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private module GoodInputTypeConfig implements DataFlow::ConfigSig {
106106
}
107107
}
108108

109-
private module GoodInputTypeFlow = DataFlow::Make<GoodInputTypeConfig>;
109+
private module GoodInputTypeFlow = DataFlow::Global<GoodInputTypeConfig>;
110110

111111
/** Gets a regex indicating that an input field may contain sensitive data. */
112112
private string getInputSensitiveInfoRegex() {
@@ -131,7 +131,7 @@ AndroidEditableXmlElement getASensitiveCachedInput() {
131131
(
132132
not inputTypeNotCached(result.getInputType()) and
133133
not exists(DataFlow::Node sink |
134-
GoodInputTypeFlow::hasFlowTo(sink) and
134+
GoodInputTypeFlow::flowTo(sink) and
135135
sink.asExpr() = setInputTypeForId(result.getId())
136136
)
137137
)

java/ql/lib/semmle/code/java/security/UnsafeAndroidAccessQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ module FetchUntrustedResourceConfig implements DataFlow::ConfigSig {
3737
/**
3838
* Detects taint flow from untrusted inputs to a resource fetching call.
3939
*/
40-
module FetchUntrustedResourceFlow = TaintTracking::Make<FetchUntrustedResourceConfig>;
40+
module FetchUntrustedResourceFlow = TaintTracking::Global<FetchUntrustedResourceConfig>;

java/ql/lib/semmle/code/java/security/WebviewDebuggingEnabledQuery.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ module WebviewDebugEnabledConfig implements DataFlow::ConfigSig {
6767
/**
6868
* Tracks instances of `setWebContentDebuggingEnabled` with `true` values.
6969
*/
70-
module WebviewDebugEnabledFlow = DataFlow::Make<WebviewDebugEnabledConfig>;
70+
module WebviewDebugEnabledFlow = DataFlow::Global<WebviewDebugEnabledConfig>;

java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ import semmle.code.java.security.WebviewDebuggingEnabledQuery
1515
import WebviewDebugEnabledFlow::PathGraph
1616

1717
from WebviewDebugEnabledFlow::PathNode source, WebviewDebugEnabledFlow::PathNode sink
18-
where WebviewDebugEnabledFlow::hasFlowPath(source, sink)
18+
where WebviewDebugEnabledFlow::flowPath(source, sink)
1919
select sink, source, sink, "Webview debugging is enabled."

java/ql/src/Security/CWE/CWE-749/UnsafeAndroidAccess.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ import semmle.code.java.security.UnsafeAndroidAccessQuery
1717
import FetchUntrustedResourceFlow::PathGraph
1818

1919
from FetchUntrustedResourceFlow::PathNode source, FetchUntrustedResourceFlow::PathNode sink
20-
where FetchUntrustedResourceFlow::hasFlowPath(source, sink)
20+
where FetchUntrustedResourceFlow::flowPath(source, sink)
2121
select sink.getNode(), source, sink, "Unsafe resource fetching in Android WebView due to $@.",
2222
source.getNode(), sink.getNode().(UrlResourceSink).getSinkType()

java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import semmle.code.java.security.AndroidIntentRedirectionQuery
1818
import IntentRedirectionFlow::PathGraph
1919

2020
from IntentRedirectionFlow::PathNode source, IntentRedirectionFlow::PathNode sink
21-
where IntentRedirectionFlow::hasFlowPath(source, sink)
21+
where IntentRedirectionFlow::flowPath(source, sink)
2222
select sink.getNode(), source, sink,
2323
"Arbitrary Android activities or services can be started from a $@.", source.getNode(),
2424
"user-provided value"

java/ql/test/query-tests/security/CWE-489/webview-debugging/WebviewDebuggingEnabled.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class HasFlowTest extends InlineFlowTest {
66
override predicate hasTaintFlow(DataFlow::Node src, DataFlow::Node sink) { none() }
77

88
override predicate hasValueFlow(DataFlow::Node src, DataFlow::Node sink) {
9-
WebviewDebugEnabledFlow::hasFlow(src, sink)
9+
WebviewDebugEnabledFlow::flow(src, sink)
1010
}
1111
}

0 commit comments

Comments
 (0)