Skip to content

Commit 55b79f4

Browse files
committed
recognize commands with slash and underscore
1 parent 320879b commit 55b79f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

javascript/ql/src/semmle/javascript/security/dataflow/UnsafeShellCommandConstructionCustomizations.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module UnsafeShellCommandConstruction {
8585
this = root.getALeaf() and
8686
root = isExecutedAsShellCommand(DataFlow::TypeBackTracker::end(), sys) and
8787
exists(string prev | prev = this.getPreviousLeaf().getStringValue() |
88-
prev.regexpMatch(".* ('|\")?[0-9a-zA-Z/:]*")
88+
prev.regexpMatch(".* ('|\")?[0-9a-zA-Z/:_-]*")
8989
)
9090
}
9191

@@ -132,7 +132,7 @@ module UnsafeShellCommandConstruction {
132132
this = call.getFormatArgument(_) and
133133
call = isExecutedAsShellCommand(DataFlow::TypeBackTracker::end(), sys) and
134134
exists(string formatString | call.getFormatString().mayHaveStringValue(formatString) |
135-
formatString.regexpMatch(".* ('|\")?[0-9a-zA-Z/:]*%.*")
135+
formatString.regexpMatch(".* ('|\")?[0-9a-zA-Z/:_-]*%.*")
136136
)
137137
}
138138

0 commit comments

Comments
 (0)