|
10 | 10 |
|
11 | 11 | *This shell command depends on an uncontrolled [absolute path](https://github.com/github/codeql/blob/48015e5a2e6202131f2d1062cc066dc33ed69a9b/javascript/ql/src/Security/CWE-078/examples/shell-command-injection-from-environment.js#L4-L4).* |
12 | 12 |
|
| 13 | +#### Paths |
| 14 | + |
13 | 15 | <details> |
14 | | -<summary>Show paths</summary> |
| 16 | +<summary>Path with 5 steps</summary> |
15 | 17 |
|
16 | | -#### Path with 5 steps |
17 | 18 | 1. [javascript/ql/src/Security/CWE-078/examples/shell-command-injection-from-environment.js](https://github.com/github/codeql/blob/48015e5a2e6202131f2d1062cc066dc33ed69a9b/javascript/ql/src/Security/CWE-078/examples/shell-command-injection-from-environment.js#L4-L4) |
18 | 19 | <pre><code class="javascript"> path = require("path"); |
19 | 20 | function cleanupTemp() { |
|
69 | 70 |
|
70 | 71 | *This shell command depends on an uncontrolled [absolute path](https://github.com/github/codeql/blob/48015e5a2e6202131f2d1062cc066dc33ed69a9b/javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js#L6-L6).* |
71 | 72 |
|
| 73 | +#### Paths |
| 74 | + |
72 | 75 | <details> |
73 | | -<summary>Show paths</summary> |
| 76 | +<summary>Path with 3 steps</summary> |
74 | 77 |
|
75 | | -#### Path with 3 steps |
76 | 78 | 1. [javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js](https://github.com/github/codeql/blob/48015e5a2e6202131f2d1062cc066dc33ed69a9b/javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js#L6-L6) |
77 | 79 | <pre><code class="javascript">(function() { |
78 | 80 | cp.execFileSync('rm', ['-rf', path.join(__dirname, "temp")]); // GOOD |
|
113 | 115 |
|
114 | 116 | *This shell command depends on an uncontrolled [absolute path](https://github.com/github/codeql/blob/48015e5a2e6202131f2d1062cc066dc33ed69a9b/javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js#L8-L8).* |
115 | 117 |
|
| 118 | +#### Paths |
| 119 | + |
116 | 120 | <details> |
117 | | -<summary>Show paths</summary> |
| 121 | +<summary>Path with 3 steps</summary> |
118 | 122 |
|
119 | | -#### Path with 3 steps |
120 | 123 | 1. [javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js](https://github.com/github/codeql/blob/48015e5a2e6202131f2d1062cc066dc33ed69a9b/javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js#L8-L8) |
121 | 124 | <pre><code class="javascript"> cp.execSync('rm -rf ' + path.join(__dirname, "temp")); // BAD |
122 | 125 |
|
|
157 | 160 |
|
158 | 161 | *This shell command depends on an uncontrolled [absolute path](https://github.com/github/codeql/blob/48015e5a2e6202131f2d1062cc066dc33ed69a9b/javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js#L9-L9).* |
159 | 162 |
|
| 163 | +#### Paths |
| 164 | + |
160 | 165 | <details> |
161 | | -<summary>Show paths</summary> |
| 166 | +<summary>Path with 3 steps</summary> |
162 | 167 |
|
163 | | -#### Path with 3 steps |
164 | 168 | 1. [javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js](https://github.com/github/codeql/blob/48015e5a2e6202131f2d1062cc066dc33ed69a9b/javascript/ql/test/query-tests/Security/CWE-078/tst_shell-command-injection-from-environment.js#L9-L9) |
165 | 169 | <pre><code class="javascript"> |
166 | 170 | execa.shell('rm -rf ' + path.join(__dirname, "temp")); // NOT OK |
|
0 commit comments