|
1 | 1 | import java |
2 | | -import semmle.code.java.dataflow.DataFlow |
3 | | -import semmle.code.java.dataflow.FlowSources |
4 | | -import semmle.code.java.security.OgnlInjection |
| 2 | +import semmle.code.java.security.OgnlInjectionQuery |
5 | 3 | import TestUtilities.InlineExpectationsTest |
6 | 4 |
|
7 | | -class Conf extends TaintTracking::Configuration { |
8 | | - Conf() { this = "qltest:cwe:ognl-injection" } |
9 | | - |
10 | | - override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource } |
11 | | - |
12 | | - override predicate isSink(DataFlow::Node sink) { sink instanceof OgnlInjectionSink } |
13 | | - |
14 | | - override predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) { |
15 | | - any(OgnlInjectionAdditionalTaintStep c).step(node1, node2) |
16 | | - } |
17 | | -} |
18 | | - |
19 | 5 | class OgnlInjectionTest extends InlineExpectationsTest { |
20 | 6 | OgnlInjectionTest() { this = "HasOgnlInjection" } |
21 | 7 |
|
22 | 8 | override string getARelevantTag() { result = "hasOgnlInjection" } |
23 | 9 |
|
24 | 10 | override predicate hasActualResult(Location location, string element, string tag, string value) { |
25 | 11 | tag = "hasOgnlInjection" and |
26 | | - exists(DataFlow::Node src, DataFlow::Node sink, Conf conf | conf.hasFlow(src, sink) | |
| 12 | + exists(DataFlow::Node src, DataFlow::Node sink, OgnlInjectionFlowConfig conf | |
| 13 | + conf.hasFlow(src, sink) |
| 14 | + | |
27 | 15 | sink.getLocation() = location and |
28 | 16 | element = sink.toString() and |
29 | 17 | value = "" |
|
0 commit comments