remove regular expression that did nothing

This commit is contained in:
erik-krogh
2023-01-23 16:38:09 +01:00
parent 79e161e046
commit 11894144aa

View File

@@ -92,9 +92,7 @@ module UnsafeShellCommandConstruction {
StringConcatEndingInCommandExecutionSink() {
this = root.getALeaf() and
root = isExecutedAsShellCommand(DataFlow::TypeBackTracker::end(), sys) and
exists(string prev | prev = this.getPreviousLeaf().getStringValue() |
prev.regexpMatch(".*\\s*('|\")?[0-9a-zA-Z/:_-]*")
)
exists(this.getPreviousLeaf().getStringValue()) // looks like a shell command construction that could be done safer, it has a known prefix
}
override string getSinkType() { result = "string concatenation" }