-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathFlowTest.ql
More file actions
28 lines (22 loc) · 874 Bytes
/
FlowTest.ql
File metadata and controls
28 lines (22 loc) · 874 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
import java
import semmle.code.java.dataflow.FlowSources
import utils.test.InlineExpectationsTest
module TestConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
predicate isSink(DataFlow::Node sink) {
exists(MethodCall call |
call.getMethod().hasName("sink") and call.getArgument(0) = sink.asExpr()
)
}
}
module TestFlow = TaintTracking::Global<TestConfig>;
module JmsFlowTest implements TestSig {
string getARelevantTag() { result = "tainted" }
predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "tainted" and
exists(TestFlow::PathNode sink | TestFlow::flowPath(_, sink) |
location = sink.getNode().getLocation() and element = sink.getNode().toString() and value = ""
)
}
}
import MakeTest<JmsFlowTest>