|
12 | 12 | * external/cwe/cwe-088 |
13 | 13 | */ |
14 | 14 |
|
15 | | -import semmle.code.java.Expr |
16 | | -import semmle.code.java.dataflow.FlowSources |
17 | | -import semmle.code.java.security.ExternalProcess |
18 | | -import semmle.code.java.security.CommandArguments |
19 | | - |
20 | | -module LocalUserInputToArgumentToExecFlowConfig implements DataFlow::ConfigSig { |
21 | | - predicate isSource(DataFlow::Node src) { src instanceof LocalUserInput } |
22 | | - |
23 | | - predicate isSink(DataFlow::Node sink) { sink.asExpr() instanceof ArgumentToExec } |
24 | | - |
25 | | - predicate isBarrier(DataFlow::Node node) { |
26 | | - node.getType() instanceof PrimitiveType |
27 | | - or |
28 | | - node.getType() instanceof BoxedType |
29 | | - or |
30 | | - isSafeCommandArgument(node.asExpr()) |
31 | | - } |
32 | | -} |
33 | | - |
34 | | -module LocalUserInputToArgumentToExecFlow = |
35 | | - TaintTracking::Global<LocalUserInputToArgumentToExecFlowConfig>; |
36 | | - |
| 15 | +import semmle.code.java.security.CommandLineQuery |
37 | 16 | import LocalUserInputToArgumentToExecFlow::PathGraph |
38 | 17 |
|
39 | 18 | from |
40 | 19 | LocalUserInputToArgumentToExecFlow::PathNode source, |
41 | | - LocalUserInputToArgumentToExecFlow::PathNode sink, ArgumentToExec execArg |
42 | | -where |
43 | | - LocalUserInputToArgumentToExecFlow::flowPath(source, sink) and |
44 | | - sink.getNode().asExpr() = execArg |
45 | | -select execArg, source, sink, "This command line depends on a $@.", source.getNode(), |
46 | | - "user-provided value" |
| 20 | + LocalUserInputToArgumentToExecFlow::PathNode sink |
| 21 | +where LocalUserInputToArgumentToExecFlow::flowPath(source, sink) |
| 22 | +select sink.getNode().asExpr(), source, sink, "This command line depends on a $@.", |
| 23 | + source.getNode(), "user-provided value" |
0 commit comments