-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathPathNodes.ql
More file actions
34 lines (29 loc) · 1.06 KB
/
PathNodes.ql
File metadata and controls
34 lines (29 loc) · 1.06 KB
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
31
32
33
34
/**
* @kind path-problem
*/
import python
import semmle.python.dataflow.new.DataFlow
import semmle.python.dataflow.new.TaintTracking
import utils.test.dataflow.testConfig
import utils.test.InlineExpectationsTest
module TestTaintFlow = TaintTracking::Global<TestConfig>;
module PathNodeTest implements TestSig {
string getARelevantTag() { result = "path-node" }
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(TestTaintFlow::PathNode pn |
location = pn.getNode().getLocation() and
tag = "path-node" and
value = "" and
element = pn.toString()
)
}
}
import MakeTest<PathNodeTest>
// running the query to inspect the results can be quite nice!
// just uncomment these lines!
// import TestTaintFlow::PathGraph
// from TestTaintFlow::PathNode source, TestTaintFlow::PathNode sink
// where TestTaintFlow::flowPath(source, sink)
// select sink.getNode(), source, sink,
// sink.getNode().getEnclosingCallable().toString() + ": --> " +
// sink.getNode().getLocation().getStartLine().toString()