Skip to content

Commit bc5b745

Browse files
committed
add failing test
1 parent b8e1aa6 commit bc5b745

File tree

1 file changed

+5
-1
lines changed
  • javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib

1 file changed

+5
-1
lines changed

javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ module.exports.foo = function (name) {
88
cp.exec("rm -rf " + name); // NOT OK - this is being called explicitly from child_process-test.js
99
};
1010

11-
module.exports.amd = require("./amd.js");
11+
module.exports.amd = require("./amd.js");
12+
13+
module.exports.arrToShell = function (cmd, arr) {
14+
cp.spawn("echo", arr, {shell: true}); // NOT OK - but not flagged [INCONSISTENCY]
15+
}

0 commit comments

Comments
 (0)