Swift: Promote the command injection query out of experimental#14701
Swift: Promote the command injection query out of experimental#14701geoffw0 merged 4 commits intogithub:mainfrom
Conversation
|
QHelp previews: swift/ql/src/queries/Security/CWE-078/CommandInjection.qhelpSystem command built from user-controlled sourcesConstructing a system command with unsanitized user input is dangerous, since a malicious user may be able to craft input that executes arbitrary code. RecommendationIf possible, use hard-coded string literals to specify the command to run. Instead of interpreting user input directly as command names, examine the input and then choose among hard-coded string literals. If this is not possible, then add sanitization code to verify that the user input is safe before using it. ExampleThe following example executes code from user input without sanitizing it first: If user input is used to construct a command it should be checked first. This ensures that the user cannot insert characters that have special meanings: References
|
|
DCA looks good to me. |
MathiasVP
left a comment
There was a problem hiding this comment.
One comment, but otherwise this LGTM
Promote
swift/command-line-injectionout from experimental. The query was added in #13726 and has evolved a bit while in experimental (in particular #13906, #14357 and #14661 - the latter is yet to be merged but should not conflict with this PR).@maikypedia FYI
TODO: