Skip to content

Commit e14be0e

Browse files
committed
Add BAD markers to samples
1 parent 709649e commit e14be0e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironmentName.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
33
String value = request.getParameter("value");
44

55
Map<String, String> env = processBuilder.environment();
6-
env.put(attribute, value);
6+
// BAD: attr and value are tainted and being added to the environment
7+
env.put(attr, value);
78

89
processBuilder.start();
910
}

java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironmentValue.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
22
String path = request.getParameter("path");
33

44
Map<String, String> env = processBuilder.environment();
5+
// BAD: path is tainted and being added to the environment
56
env.put("PATH", path);
67

78
processBuilder.start();

0 commit comments

Comments
 (0)