We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4b02cd commit d73905cCopy full SHA for d73905c
src/main/java/CommandInjection.java
@@ -0,0 +1,13 @@
1
+// https://documentation.blackduck.com/bundle/coverity-docs/page/checker-ref/checkers/NO/os_cmd_injection.html
2
+
3
+import java.io.*;
4
+import javax.servlet.http.HttpServletRequest;
5
6
+public class CommandInjection {
7
+ public static Process runCmd(HttpServletRequest request) throws IOException {
8
+ String filename = request.getParameter("filename");
9
+ ProcessBuilder builder = new ProcessBuilder("cat", filename);
10
+ Process process = builder.start();
11
+ return(process);
12
+ }
13
+}
0 commit comments