Skip to content

Commit

Permalink
[api] [security] [fix] Ensure backticks escape
Browse files Browse the repository at this point in the history
  * Fixes eval issue for for perl and bash #31
  * Should be working for some cases, but not all
  * Requires additional review
  • Loading branch information
Marak committed Feb 18, 2017
1 parent 40e5b06 commit ae64781
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugins/spawn/generateCommandLineArguments/bash/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function bashEscape (arg) {
} else {
}
*/
str = arg.toString().replace(/"/g, '\'');
str = str.replace(/`/g, '');
str = str.replace(/"/g, '\'');
str = str.split("\r\n");
str = str.join(" ");
return str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ function perlEscape (arg) {
return "";
}
var str = arg.toString();
str = str.replace(/`/g, '');
str = str.split("\r\n");
str = str.join(" ");
return str;
Expand Down

0 comments on commit ae64781

Please sign in to comment.