1
1
import java
2
- private import semmle.code.java.dataflow.FlowSteps
3
- private import semmle.code.java.dataflow.ExternalFlow
4
- private import semmle.code.java.dataflow.FlowSummary
5
- private import semmle.code.java.dataflow.DataFlow
6
- private import semmle.code.java.dataflow.TaintTracking
7
2
private import semmle.code.java.dataflow.FlowSources
8
3
9
4
string supportKind ( Callable api ) {
@@ -22,27 +17,21 @@ string supportKind(Callable api) {
22
17
}
23
18
24
19
predicate summaryCall ( Callable api ) {
25
- api instanceof SummarizedCallable
26
- or
27
- exists ( Call call , DataFlow:: Node arg |
28
- call .getCallee ( ) = api and
29
- [ call .getAnArgument ( ) , call .getQualifier ( ) ] = arg .asExpr ( ) and
30
- TaintTracking:: localAdditionalTaintStep ( arg , _)
31
- )
20
+ summaryModel ( packageName ( api ) , typeName ( api ) , _, api .getName ( ) , _, _, _, _, _)
32
21
}
33
22
34
23
predicate sink ( Callable api ) {
35
- exists ( Call call , DataFlow:: Node arg |
36
- call .getCallee ( ) = api and
37
- [ call .getAnArgument ( ) , call .getQualifier ( ) ] = arg .asExpr ( ) and
38
- sinkNode ( arg , _)
39
- )
24
+ sinkModel ( packageName ( api ) , typeName ( api ) , _, api .getName ( ) , _, _, _, _)
40
25
}
41
26
42
27
predicate source ( Callable api ) {
43
- exists ( Call call , DataFlow:: Node arg |
44
- call .getCallee ( ) = api and
45
- [ call .getAnArgument ( ) , call .getQualifier ( ) ] = arg .asExpr ( ) and
46
- arg instanceof RemoteFlowSource
47
- )
28
+ sourceModel ( packageName ( api ) , typeName ( api ) , _, api .getName ( ) , _, _, _, _)
29
+ }
30
+
31
+ private string packageName ( Callable api ) {
32
+ result = api .getCompilationUnit ( ) .getPackage ( ) .toString ( )
33
+ }
34
+
35
+ private string typeName ( Callable api ) {
36
+ result = api .getDeclaringType ( ) .getAnAncestor ( ) .getSourceDeclaration ( ) .toString ( )
48
37
}
0 commit comments