add support for util.promisify with child_process calls

This commit is contained in:
Erik Krogh Kristensen
2020-04-15 14:06:16 +02:00
parent bfd80b42a7
commit e8dc77d508
3 changed files with 33 additions and 0 deletions

View File

@@ -594,6 +594,14 @@ module NodeJSLib {
ChildProcessMethodCall() {
this = DataFlow::moduleMember("child_process", methodName).getACall()
or
exists(DataFlow::CallNode promisify |
promisify = DataFlow::moduleMember("util", "promisify").getACall()
|
this = promisify.getACall() and
promisify.getArgument(0).getALocalSource() =
DataFlow::moduleMember("child_process", methodName)
)
}
private DataFlow::Node getACommandArgument(boolean shell) {