Merge pull request #4460 from max-schaefer/js/unsafe-shell-command-construction-infeasible-paths

Approved by asgerf
This commit is contained in:
CodeQL CI
2020-10-16 05:05:29 -07:00
committed by GitHub
3 changed files with 47 additions and 1 deletions

View File

@@ -31,5 +31,15 @@ module UnsafeShellCommandConstruction {
guard instanceof PathExistsSanitizerGuard or
guard instanceof TaintTracking::AdHocWhitelistCheckSanitizer
}
// override to require that there is a path without unmatched return steps
override predicate hasFlowPath(DataFlow::SourcePathNode source, DataFlow::SinkPathNode sink) {
super.hasFlowPath(source, sink) and
exists(DataFlow::MidPathNode mid |
source.getASuccessor*() = mid and
sink = mid.getASuccessor() and
mid.getPathSummary().hasReturn() = false
)
}
}
}