mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
delete old tests
This commit is contained in:
@@ -1,68 +0,0 @@
|
||||
test_FileSystemAccess
|
||||
| tst.js:22:9:22:23 | { shell: true } |
|
||||
| tst.js:24:9:24:24 | { shell: false } |
|
||||
| tst.js:28:13:28:22 | 'aCommand' |
|
||||
| tst.js:28:25:28:36 | ['example1'] |
|
||||
| tst.js:30:13:30:17 | 'git' |
|
||||
| tst.js:30:20:30:31 | ['example1'] |
|
||||
| tst.js:32:13:32:47 | 'echo e ... ple 11' |
|
||||
| tst.js:32:50:32:64 | { shell: true } |
|
||||
| tst.js:33:13:33:29 | 'echo example 10' |
|
||||
| tst.js:33:32:33:52 | ['; ech ... le 11'] |
|
||||
| tst.js:33:55:33:69 | { shell: true } |
|
||||
| tst.js:36:11:36:16 | 'echo' |
|
||||
| tst.js:36:19:36:35 | ['example5 sync'] |
|
||||
| tst.js:38:20:38:41 | "git " ... gument" |
|
||||
| tst.js:39:20:39:51 | `git ${ ... ndSync` |
|
||||
| tst.js:41:18:41:20 | arg |
|
||||
| tst.js:43:18:43:39 | "echo 1 ... echo 2" |
|
||||
| tst.js:43:42:43:56 | { shell: true } |
|
||||
| tst.js:49:9:49:27 | { inputFile: file } |
|
||||
| tst.js:50:13:50:17 | 'cat' |
|
||||
| tst.js:50:20:50:38 | { inputFile: file } |
|
||||
| tst.js:51:13:51:18 | 'echo' |
|
||||
| tst.js:51:21:51:32 | ['example2'] |
|
||||
| tst.js:52:13:52:18 | 'echo' |
|
||||
| tst.js:52:21:52:32 | ['example3'] |
|
||||
| tst.js:53:13:53:18 | 'echo' |
|
||||
| tst.js:53:21:53:32 | ['example4'] |
|
||||
| tst.js:53:35:53:47 | { all: true } |
|
||||
test_MissingFileSystemAccess
|
||||
| tst.js:47:35:47:38 | file |
|
||||
| tst.js:51:46:51:49 | file |
|
||||
| tst.js:52:46:52:49 | file |
|
||||
| tst.js:53:58:53:61 | file |
|
||||
test_SystemCommandExecution
|
||||
| tst.js:1:71:1:71 | $ |
|
||||
| tst.js:7:7:7:7 | $ |
|
||||
| tst.js:9:7:9:7 | $ |
|
||||
| tst.js:10:1:10:1 | $ |
|
||||
| tst.js:10:1:10:6 | $.sync |
|
||||
| tst.js:14:7:14:7 | $ |
|
||||
| tst.js:16:7:16:7 | $ |
|
||||
| tst.js:17:1:17:1 | $ |
|
||||
| tst.js:17:1:17:6 | $.sync |
|
||||
| tst.js:19:1:19:1 | $ |
|
||||
| tst.js:19:1:19:6 | $.sync |
|
||||
| tst.js:20:7:20:7 | $ |
|
||||
| tst.js:22:7:22:7 | $ |
|
||||
| tst.js:22:7:22:24 | $({ shell: true }) |
|
||||
| tst.js:24:7:24:7 | $ |
|
||||
| tst.js:24:7:24:25 | $({ shell: false }) |
|
||||
| tst.js:28:7:28:37 | execa(' ... ple1']) |
|
||||
| tst.js:30:7:30:32 | execa(' ... ple1']) |
|
||||
| tst.js:32:7:32:65 | execa(' ... true }) |
|
||||
| tst.js:33:7:33:70 | execa(' ... true }) |
|
||||
| tst.js:36:1:36:36 | execaSy ... sync']) |
|
||||
| tst.js:38:7:38:42 | execaCo ... ument") |
|
||||
| tst.js:39:7:39:52 | execaCo ... dSync`) |
|
||||
| tst.js:41:1:41:21 | execaCo ... nc(arg) |
|
||||
| tst.js:43:1:43:57 | execaCo ... true }) |
|
||||
| tst.js:47:7:47:7 | $ |
|
||||
| tst.js:49:7:49:7 | $ |
|
||||
| tst.js:49:7:49:28 | $({ inp ... file }) |
|
||||
| tst.js:50:7:50:39 | execa(' ... file }) |
|
||||
| tst.js:51:7:51:33 | execa(' ... ple2']) |
|
||||
| tst.js:52:7:52:33 | execa(' ... ple3']) |
|
||||
| tst.js:53:7:53:48 | execa(' ... true }) |
|
||||
test_FileNameSource
|
||||
@@ -1,53 +0,0 @@
|
||||
import { execa, execaSync, execaCommand, execaCommandSync, execaNode, $ } from 'execa';
|
||||
|
||||
const arg = process.argv[0];
|
||||
|
||||
// Node.js scripts
|
||||
// GOOD
|
||||
await $`echo example1`.pipeStderr(`tmp`);
|
||||
// BAD argument injection
|
||||
await $`ssh ${"example2"}`.pipeStderr(`tmp`);
|
||||
$.sync`echo example2 sync`
|
||||
// Multiple arguments
|
||||
const args = ["arg:" + arg, 'example3', '&', 'rainbows!'];
|
||||
// GOOD
|
||||
await $`${arg} sth`;
|
||||
// GOOD only one command can be executed
|
||||
await $`${arg}`;
|
||||
$.sync`${arg}`
|
||||
// BAD argument injection
|
||||
$.sync`git ${args} ${args}`
|
||||
await $`git ${["-o", "-lps"]}`
|
||||
// if shell: true then all inputs except first are dangerous
|
||||
await $({ shell: true })`echo example6 ${";echo example6 > tmpdir/example6"}`
|
||||
// GOOD
|
||||
await $({ shell: false })`echo example6 ${";echo example6 > tmpdir/example6"}`
|
||||
|
||||
// execa
|
||||
// GOOD
|
||||
await execa('aCommand', ['example1']);
|
||||
// BAD argument injection
|
||||
await execa('git', ['example1']);
|
||||
// BAD shell is enable
|
||||
await execa('echo example 10 ; echo example 11', { shell: true });
|
||||
await execa('echo example 10', ['; echo example 11'], { shell: true });
|
||||
|
||||
// BAD argument injection
|
||||
execaSync('echo', ['example5 sync']);
|
||||
// BAD argument injection
|
||||
await execaCommand("git " + "badArgument");
|
||||
await execaCommand(`git ${"arg1"} execaCommandSync`);
|
||||
// bad totally controllable argument
|
||||
execaCommandSync(arg);
|
||||
// BAD shell is enable
|
||||
execaCommandSync("echo 1 " + "; echo 2", { shell: true });
|
||||
|
||||
// FileSystemAccess
|
||||
// Piping stdout to a file
|
||||
await $`echo example8`.pipeStdout(file)
|
||||
// Piping stdin from a file
|
||||
await $({ inputFile: file })`cat`
|
||||
await execa('cat', { inputFile: file });
|
||||
await execa('echo', ['example2']).pipeStdout(file);
|
||||
await execa('echo', ['example3']).pipeStderr(file);
|
||||
await execa('echo', ['example4'], { all: true }).pipeAll(file);
|
||||
Reference in New Issue
Block a user