allow parameters that end with "Command" in js/shell-command-constructed-from-input

This commit is contained in:
Erik Krogh Kristensen
2021-04-12 09:57:40 +02:00
parent 2d618d6b92
commit 17c4bbbc4e
2 changed files with 11 additions and 1 deletions

View File

@@ -53,7 +53,12 @@ module UnsafeShellCommandConstruction {
class ExternalInputSource extends Source, DataFlow::ParameterNode {
ExternalInputSource() {
this = Exports::getALibraryInputParameter() and
not this.getName() = ["cmd", "command"] // looks to be on purpose.
not (
// looks to be on purpose.
this.getName() = ["cmd", "command"]
or
this.getName().regexpMatch(".*(Cmd|Command)$") // ends with "Cmd" or "Command"
)
}
}