Skip to content

Commit

Permalink
Merge pull request #41189 from kalaiyarasiganeshalingam/fix
Browse files Browse the repository at this point in the history
Fix system module security vulnerability
  • Loading branch information
kalaiyarasiganeshalingam authored Aug 22, 2023
2 parents 095b040 + 563e17f commit 367d4a3
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ public class Exec {
private static final Logger log = LoggerFactory.getLogger(Exec.class);

public static Object exec(String command, MapValue<String, String> env, Object dir, ArrayValue args) {
List<String> commandList = new ArrayList<String>();
commandList.add(command);
commandList.addAll(Arrays.asList(args.getStringArray()));
String space = " ";
List<String> commandList = new ArrayList<String>(Arrays.asList(command.split(space)));
for (String arg : args.getStringArray()) {
commandList.addAll(Arrays.asList(arg.split(space)));
}
ProcessBuilder pb = new ProcessBuilder(commandList);
if (dir != null) {
pb.directory(new File((String) dir));
Expand Down

0 comments on commit 367d4a3

Please sign in to comment.