Skip to content

Commit 21b70a0

Browse files
committed
Use CSV models
1 parent 9604f88 commit 21b70a0

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

java/ql/src/semmle/code/java/security/AndroidIntentRedirection.qll

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java
44
private import semmle.code.java.dataflow.DataFlow
5+
private import semmle.code.java.dataflow.ExternalFlow
56
private import semmle.code.java.frameworks.android.Intent
67

78
/**
@@ -28,19 +29,5 @@ class IntentRedirectionAdditionalTaintStep extends Unit {
2829

2930
/** Default sink for Intent redirection vulnerabilities. */
3031
private class DefaultIntentRedirectionSink extends IntentRedirectionSink {
31-
DefaultIntentRedirectionSink() {
32-
exists(MethodAccess ma, Method m |
33-
ma.getMethod() = m and
34-
this.asExpr() = ma.getAnArgument() and
35-
(
36-
this.asExpr().getType() instanceof TypeIntent
37-
or
38-
this.asExpr().getType().(Array).getComponentType() instanceof TypeIntent
39-
)
40-
|
41-
m instanceof StartActivityMethod or
42-
m instanceof StartServiceMethod or
43-
m instanceof SendBroadcastMethod
44-
)
45-
}
32+
DefaultIntentRedirectionSink() { sinkNode(this, "intent-start") }
4633
}

java/ql/test/query-tests/security/CWE-940/AndroidIntentRedirectionTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public void onCreate(Bundle savedInstanceState) {
1818
startActivityAsUser(intent, null); // $ hasAndroidIntentRedirection
1919
startActivityAsUser(intent, null, null); // $ hasAndroidIntentRedirection
2020
startActivityAsCaller(intent, null, false, 0); // $ hasAndroidIntentRedirection
21-
startActivityAsUserFromFragment(null, intent, 0, null, null); // $ hasAndroidIntentRedirection
2221
startActivityForResult(intent, 0); // $ hasAndroidIntentRedirection
2322
startActivityForResult(intent, 0, null); // $ hasAndroidIntentRedirection
2423
startActivityForResult(null, intent, 0, null); // $ hasAndroidIntentRedirection

0 commit comments

Comments
 (0)