Skip to content

Commit 102f09a

Browse files
committed
extend tests
1 parent 18d0b28 commit 102f09a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

javascript/ql/test/experimental/Security/CWE-099/EnvInjection.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@ nodes
88
| test.js:5:35:5:42 | EnvValue |
99
| test.js:6:23:6:30 | EnvValue |
1010
| test.js:6:23:6:30 | EnvValue |
11+
| test.js:7:22:7:29 | EnvValue |
12+
| test.js:7:22:7:29 | EnvValue |
1113
edges
1214
| test.js:4:9:4:20 | { EnvValue } | test.js:4:11:4:18 | EnvValue |
1315
| test.js:4:9:4:31 | EnvValue | test.js:5:35:5:42 | EnvValue |
1416
| test.js:4:9:4:31 | EnvValue | test.js:5:35:5:42 | EnvValue |
1517
| test.js:4:9:4:31 | EnvValue | test.js:6:23:6:30 | EnvValue |
1618
| test.js:4:9:4:31 | EnvValue | test.js:6:23:6:30 | EnvValue |
19+
| test.js:4:9:4:31 | EnvValue | test.js:7:22:7:29 | EnvValue |
20+
| test.js:4:9:4:31 | EnvValue | test.js:7:22:7:29 | EnvValue |
1721
| test.js:4:11:4:18 | EnvValue | test.js:4:9:4:31 | EnvValue |
1822
| test.js:4:24:4:31 | req.body | test.js:4:9:4:20 | { EnvValue } |
1923
| test.js:4:24:4:31 | req.body | test.js:4:9:4:20 | { EnvValue } |
2024
#select
2125
| test.js:5:35:5:42 | EnvValue | test.js:4:24:4:31 | req.body | test.js:5:35:5:42 | EnvValue | this environment variable assignment is $@. | test.js:4:24:4:31 | req.body | user controllable |
2226
| test.js:6:23:6:30 | EnvValue | test.js:4:24:4:31 | req.body | test.js:6:23:6:30 | EnvValue | this environment variable assignment is $@. | test.js:4:24:4:31 | req.body | user controllable |
27+
| test.js:7:22:7:29 | EnvValue | test.js:4:24:4:31 | req.body | test.js:7:22:7:29 | EnvValue | this environment variable assignment is $@. | test.js:4:24:4:31 | req.body | user controllable |

javascript/ql/test/experimental/Security/CWE-099/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ http.createServer((req, res) => {
44
const { EnvValue } = req.body;
55
process.env["A_Critical_Env"] = EnvValue; // NOT OK
66
process.env[AKey] = EnvValue; // NOT OK
7+
process.env.AKey = EnvValue; // NOT OK
78

89
res.end('env has been injected!');
910
});

0 commit comments

Comments
 (0)