-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathflow.ql
More file actions
30 lines (26 loc) · 823 Bytes
/
flow.ql
File metadata and controls
30 lines (26 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java
import semmle.code.java.dataflow.TaintTracking
module Config implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node src) {
(
src.asExpr().(VarAccess).getVariable().hasName("tainted")
or
src.asParameter().getCallable().hasName("taintSteps")
or
src.asExpr() = any(MethodCall ma | ma.getMethod().hasName("source")).getAnArgument()
)
}
predicate isSink(DataFlow::Node sink) {
exists(MethodCall ma |
sink.asExpr() = ma.getAnArgument() and
ma.getMethod().hasName("sink")
or
sink.(DataFlow::PostUpdateNode).getPreUpdateNode().asExpr() = ma and
ma.getMethod().hasName("mkSink")
)
}
}
module Flow = TaintTracking::Global<Config>;
from DataFlow::Node src, DataFlow::Node sink
where Flow::flow(src, sink)
select src, sink