Skip to content

Commit 91f1183

Browse files
authored
Merge pull request #19354 from michaelnebel/csharp/matchlinenumbersonsinks
Shared: Match line information on Alert and Sink locations.
2 parents 37bcedc + 2e0ce44 commit 91f1183

File tree

32 files changed

+231
-230
lines changed

32 files changed

+231
-230
lines changed

javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var server = http.createServer(function(req, res) {
3636
sh = 'cmd.exe', flag = '/c';
3737
else
3838
sh = '/bin/sh', flag = '-c';
39-
cp.spawn(sh, [ flag, cmd ]); // $ Alert Sink
39+
cp.spawn(sh, [ flag, cmd ]); // $ Alert
4040

4141
let args = [];
4242
args[0] = "-c";
@@ -53,8 +53,8 @@ var server = http.createServer(function(req, res) {
5353
args[1] = cmd; // $ Sink
5454
cp.execFile(`/bin` + "/bash", args); // $ Alert
5555

56-
cp.spawn('cmd.exe', ['/C', 'foo'].concat(["bar", cmd])); // $ Alert Sink
57-
cp.spawn('cmd.exe', ['/C', 'foo'].concat(cmd)); // $ Alert Sink
56+
cp.spawn('cmd.exe', ['/C', 'foo'].concat(["bar", cmd])); // $ Alert
57+
cp.spawn('cmd.exe', ['/C', 'foo'].concat(cmd)); // $ Alert
5858

5959
let myArgs = [];
6060
myArgs.push(`-` + "c");

javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function getShell() {
1212

1313
function execSh(command, options) {
1414
var shell = getShell()
15-
return cp.spawn(shell.cmd, [shell.arg, command], options) // $ Alert Sink
15+
return cp.spawn(shell.cmd, [shell.arg, command], options) // $ Alert
1616
}
1717

1818
http.createServer(function (req, res) {

javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function getShell() {
77
}
88

99
function execSh(command, options) {
10-
return cp.spawn(getShell(), ["-c", command], options) // $ Alert Sink
10+
return cp.spawn(getShell(), ["-c", command], options) // $ Alert
1111
};
1212

1313
http.createServer(function (req, res) {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
const cp = require("child_process");
44

55
module.exports.thisMethodIsImported = function (name) { // $ Source
6-
cp.exec("rm -rf " + name); // $ Alert Sink
7-
}
6+
cp.exec("rm -rf " + name); // $ Alert
7+
}

0 commit comments

Comments
 (0)