Injection attacks on Runtime.exec
Hey all,
I am trying to prove that an injection attack is not possible on the following code, where "filePath" and "args" are supplied from an unknown source.
Process p = Runtime.getRuntime().exec("java -Djava.security.manager " + filePath + " " + args, null, new File("C:\\Program Files\\eclipse\\workspace\\bin"));
I have verified that filePath does indeed point to a Java class file that is a child of the bin directory. NB -Djava.security.manager is the default java security manager which will invoke the program with similar privileges to that of an applet (so the invoked program is fully sandboxed).
Thanks,
Will

