mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
recognize bound functions in js/shell-command-constructed-from-input
This commit is contained in:
@@ -51,10 +51,12 @@ module UnsafeShellCommandConstruction {
|
||||
*/
|
||||
class ExternalInputSource extends Source, DataFlow::ParameterNode {
|
||||
ExternalInputSource() {
|
||||
this =
|
||||
Exports::getAValueExportedBy(Exports::getTopmostPackageJSON())
|
||||
.getAFunctionValue()
|
||||
.getAParameter() and
|
||||
exists(int bound, DataFlow::FunctionNode func |
|
||||
func =
|
||||
Exports::getAValueExportedBy(Exports::getTopmostPackageJSON())
|
||||
.getABoundFunctionValue(bound) and
|
||||
this = func.getParameter(any(int arg | arg >= bound))
|
||||
) and
|
||||
not this.getName() = ["cmd", "command"] // looks to be on purpose.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user