forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.qll
More file actions
45 lines (33 loc) · 1.24 KB
/
Copy pathConfig.qll
File metadata and controls
45 lines (33 loc) · 1.24 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
40
41
42
43
44
45
import python
import semmle.python.dataflow.TaintTracking
import semmle.python.security.strings.Untrusted
class FooSource extends TaintSource {
FooSource() { this.(CallNode).getFunction().(NameNode).getId() = "foo_source" }
override predicate isSourceOf(TaintKind kind) { kind instanceof UntrustedStringKind }
override string toString() { result = "FooSource" }
}
class FooSink extends TaintSink {
FooSink() {
exists(CallNode call |
call.getFunction().(NameNode).getId() = "foo_sink" and
call.getAnArg() = this
)
}
override predicate sinks(TaintKind kind) { kind instanceof UntrustedStringKind }
override string toString() { result = "FooSink" }
}
class FooConfig extends TaintTracking::Configuration {
FooConfig() { this = "FooConfig" }
override predicate isSource(TaintTracking::Source source) { source instanceof FooSource }
override predicate isSink(TaintTracking::Sink sink) { sink instanceof FooSink }
}
class BarSink extends TaintSink {
BarSink() {
exists(CallNode call |
call.getFunction().(NameNode).getId() = "bar_sink" and
call.getAnArg() = this
)
}
override predicate sinks(TaintKind kind) { kind instanceof UntrustedStringKind }
override string toString() { result = "BarSink" }
}