-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathEdges.ql
More file actions
39 lines (35 loc) · 1.11 KB
/
Edges.ql
File metadata and controls
39 lines (35 loc) · 1.11 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
35
36
37
38
39
import python
import semmle.python.dataflow.TaintTracking
import semmle.python.dataflow.Implementation
import DilbertConfig
string shortString(TaintTrackingNode n) {
if n.getContext().isTop()
then
result =
n.getLocation().getStartLine() + ": " + n.getNode().toString() + n.getPath().extension() +
" = " + n.getTaintKind()
else
result =
n.getLocation().getStartLine() + ": " + n.getNode().toString() + n.getPath().extension() +
" = " + n.getTaintKind() + " (" + n.getContext().toString() + ")"
}
bindingset[s, len]
string ljust(string s, int len) {
result =
s +
" "
.prefix(len - s.length())
}
bindingset[s, len]
string format(string s, int len) {
exists(string label |
s = "" and label = "[dataflow]"
or
s != "" and label = s
|
result = ljust(label, len)
)
}
from TaintTrackingNode p, TaintTrackingNode s, string label
where any(DilbertConfig config).(TaintTrackingImplementation).flowStep(p, s, label)
select format(shortString(p), 50), format(label, 10), shortString(s)