add the cwd option to shell executions as a sink to js/path-injection

This commit is contained in:
Erik Krogh Kristensen
2021-08-23 07:32:05 +02:00
parent eda7616a23
commit 32ac8778bd
3 changed files with 320 additions and 1 deletions

View File

@@ -696,6 +696,18 @@ module TaintedPath {
}
}
/**
* The `cwd` option to a shell execution.
*/
private class ShellCwdSink extends TaintedPath::Sink {
ShellCwdSink() {
exists(SystemCommandExecution sys, API::Node opts |
opts.getARhs() = sys.getOptionsArg() and // assuming that an API::Node exists here.
this = opts.getMember("cwd").getARhs()
)
}
}
/**
* Holds if there is a step `src -> dst` mapping `srclabel` to `dstlabel` relevant for path traversal vulnerabilities.
*/