Skip to content

Commit

Permalink
Fix system module security vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaiyarasiganeshalingam committed Aug 10, 2023
1 parent 53fe7e4 commit 563e17f
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 563e17f

Please sign in to comment.