JavaScript: Eliminate source of false positives in UnsafeShellCommandConstruction.

This commit is contained in:
Max Schaefer
2020-10-12 14:52:23 +01:00
parent cd33d358aa
commit 1c04c07f07
2 changed files with 11 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
)
}
}
}