Skip to content

Commit ef08a91

Browse files
committed
Refactor ImproperIntentVerificationQuery.qll
1 parent 413a6cb commit ef08a91

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ private class OnReceiveMethod extends Method {
1414
}
1515

1616
/** A configuration to detect whether the `action` of an `Intent` is checked. */
17-
private class VerifiedIntentConfig extends DataFlow::Configuration {
18-
VerifiedIntentConfig() { this = "VerifiedIntentConfig" }
19-
20-
override predicate isSource(DataFlow::Node src) {
17+
private module VerifiedIntentConfig implements DataFlow::ConfigSig {
18+
predicate isSource(DataFlow::Node src) {
2119
src.asParameter() = any(OnReceiveMethod orm).getIntentParameter()
2220
}
2321

24-
override predicate isSink(DataFlow::Node sink) {
22+
predicate isSink(DataFlow::Node sink) {
2523
exists(MethodAccess ma |
2624
ma.getMethod().hasQualifiedName("android.content", "Intent", "getAction") and
2725
sink.asExpr() = ma.getQualifier()
2826
)
2927
}
3028
}
3129

30+
private module VerifiedIntentFlow = DataFlow::Make<VerifiedIntentConfig>;
31+
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 any(VerifiedIntentConfig c).hasFlow(DataFlow::parameterNode(this.getIntentParameter()), _)
35+
not VerifiedIntentFlow::hasFlow(DataFlow::parameterNode(this.getIntentParameter()), _)
3636
}
3737
}
3838

0 commit comments

Comments
 (0)