Skip to content

Commit d540cae

Browse files
erik-kroghesbena
andauthored
Apply suggestions from code review
Co-Authored-By: Esben Sparre Andreasen <esbena@github.com>
1 parent afd6ea2 commit d540cae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/ql/src/semmle/javascript/security/UselessUseOfCat.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class UselessCat extends CommandCall {
9797
getArgument(0).mayHaveStringValue(getACatExecuteable())
9898
) and
9999
// wildcards, pipes, redirections, other bash features, and multiple files (spaces) are OK.
100-
not exists(getNonCommandConstantString().regexpFind("\\*|\\||>|<| |\\$|&|,|\\`", _, _)) and
100+
not exists(getNonCommandConstantString().regexpFind("\\*|\\||>|<| |\\$|&|,|\\`| ", _, _)) and
101101
// Only acceptable option is "encoding", everything else is non-trivial to emulate with fs.readFile.
102102
(
103103
not exists(getOptionsArg())
@@ -135,7 +135,7 @@ class UselessCat extends CommandCall {
135135
* Gets a string used to call `cat`.
136136
*/
137137
string getACatExecuteable() {
138-
result = "cat" or result = "/bin/cat" or result = "sudo cat" or result = "sudo /bin/cat"
138+
result = "cat" or result = "/bin/cat"
139139
}
140140

141141
/**

0 commit comments

Comments
 (0)