|
17 | 17 | /**
|
18 | 18 | * A taint-tracking configuration for reasoning about code injection vulnerabilities.
|
19 | 19 | */
|
20 |
| - class Configuration extends TaintTracking::Configuration { |
21 |
| - Configuration() { this = "CodeInjection" } |
| 20 | + module Config implements DataFlow::ConfigSig { |
| 21 | + predicate isSource(DataFlow::Node source) { source instanceof XssThroughDom::Source} |
22 | 22 |
|
23 |
| - override predicate isSource(DataFlow::Node source) { source instanceof XssThroughDom::Source} |
24 | 23 |
|
25 | 24 |
|
| 25 | + predicate isSink(DataFlow::Node sink) { sink instanceof Sink} |
26 | 26 |
|
27 |
| - override predicate isSink(DataFlow::Node sink) { sink instanceof Sink} |
28 |
| - |
29 |
| - override predicate isSanitizer(DataFlow::Node node) { |
30 |
| - super.isSanitizer(node) or |
| 27 | + predicate isBarrier(DataFlow::Node node) { |
31 | 28 | node instanceof Sanitizer
|
32 | 29 | }
|
33 | 30 |
|
34 |
| - override predicate isAdditionalTaintStep(DataFlow::Node src, DataFlow::Node trg) { |
| 31 | + predicate isAdditionalFlowStep(DataFlow::Node src, DataFlow::Node trg) { |
35 | 32 | // HTML sanitizers are insufficient protection against code injection
|
36 | 33 | src = trg.(HtmlSanitizerCall).getInput()
|
37 | 34 | }
|
38 | 35 |
|
39 |
| - override predicate isAdditionalLoadStep(DataFlow::Node pred, DataFlow::Node succ, string prop) { |
| 36 | + additional predicate isAdditionalLoadStep(DataFlow::Node pred, DataFlow::Node succ, string prop) { |
40 | 37 | exists(ExecuteScript ess | ess = pred and ess = succ and prop = ["file", "code"])
|
41 | 38 | }
|
42 | 39 | }
|
43 | 40 |
|
| 41 | + module ConfigFlow = TaintTracking::Global<Config>; |
| 42 | + |
44 | 43 | //Browser Extension Models
|
45 | 44 | class ExecuteScriptSink extends Sink instanceof ExecuteScript{}
|
46 | 45 | class ExternalConnect1 extends Source instanceof OnConnectExternal{}
|
|
0 commit comments