Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4de444b

Browse filesBrowse files
committed
JS: Add a few more tests
1 parent 6e5427f commit 4de444b
Copy full SHA for 4de444b

File tree

Expand file treeCollapse file tree

3 files changed

+30
-5
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+30
-5
lines changed

‎javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected

Copy file name to clipboardExpand all lines: javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ legacyDataFlowDifference
3232
| object-bypass-sanitizer.js:35:29:35:36 | source() | object-bypass-sanitizer.js:28:10:28:30 | sanitiz ... bj).foo | only flow with OLD data flow library |
3333
| promise.js:12:20:12:27 | source() | promise.js:13:8:13:23 | resolver.promise | only flow with OLD data flow library |
3434
| sanitizer-guards.js:57:11:57:18 | source() | sanitizer-guards.js:64:8:64:8 | x | only flow with NEW data flow library |
35+
| spread.js:4:15:4:22 | source() | spread.js:18:8:18:8 | y | only flow with NEW data flow library |
36+
| spread.js:4:15:4:22 | source() | spread.js:24:8:24:8 | y | only flow with NEW data flow library |
3537
| use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library |
3638
| use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:16:10:16:10 | y | only flow with NEW data flow library |
3739
consistencyIssue
@@ -250,10 +252,12 @@ flow
250252
| sanitizer-guards.js:91:11:91:18 | source() | sanitizer-guards.js:93:8:93:8 | x |
251253
| sanitizer-guards.js:91:11:91:18 | source() | sanitizer-guards.js:98:7:98:7 | x |
252254
| sanitizer-guards.js:91:11:91:18 | source() | sanitizer-guards.js:104:7:104:7 | x |
253-
| spread.js:2:15:2:22 | source() | spread.js:4:8:4:19 | { ...taint } |
254-
| spread.js:2:15:2:22 | source() | spread.js:5:8:5:43 | { f: 'h ... orld' } |
255-
| spread.js:2:15:2:22 | source() | spread.js:7:8:7:19 | [ ...taint ] |
256-
| spread.js:2:15:2:22 | source() | spread.js:8:8:8:28 | [ 1, 2, ... nt, 3 ] |
255+
| spread.js:4:15:4:22 | source() | spread.js:6:8:6:19 | { ...taint } |
256+
| spread.js:4:15:4:22 | source() | spread.js:7:8:7:43 | { f: 'h ... orld' } |
257+
| spread.js:4:15:4:22 | source() | spread.js:9:8:9:19 | [ ...taint ] |
258+
| spread.js:4:15:4:22 | source() | spread.js:10:8:10:28 | [ 1, 2, ... nt, 3 ] |
259+
| spread.js:4:15:4:22 | source() | spread.js:18:8:18:8 | y |
260+
| spread.js:4:15:4:22 | source() | spread.js:24:8:24:8 | y |
257261
| static-capture-groups.js:2:17:2:24 | source() | static-capture-groups.js:5:14:5:22 | RegExp.$1 |
258262
| static-capture-groups.js:2:17:2:24 | source() | static-capture-groups.js:15:14:15:22 | RegExp.$1 |
259263
| static-capture-groups.js:2:17:2:24 | source() | static-capture-groups.js:17:14:17:22 | RegExp.$1 |

‎javascript/ql/test/library-tests/TaintTracking/DataFlowTracking.expected

Copy file name to clipboardExpand all lines: javascript/ql/test/library-tests/TaintTracking/DataFlowTracking.expected
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ legacyDataFlowDifference
2222
| nested-props.js:27:18:27:25 | source() | nested-props.js:28:10:28:14 | obj.x | only flow with NEW data flow library |
2323
| nested-props.js:51:22:51:29 | source() | nested-props.js:52:10:52:16 | obj.x.y | only flow with NEW data flow library |
2424
| sanitizer-guards.js:57:11:57:18 | source() | sanitizer-guards.js:64:8:64:8 | x | only flow with NEW data flow library |
25+
| spread.js:4:15:4:22 | source() | spread.js:18:8:18:8 | y | only flow with NEW data flow library |
26+
| spread.js:4:15:4:22 | source() | spread.js:24:8:24:8 | y | only flow with NEW data flow library |
2527
| tst.js:2:13:2:20 | source() | tst.js:35:14:35:16 | ary | only flow with NEW data flow library |
2628
| tst.js:2:13:2:20 | source() | tst.js:41:14:41:16 | ary | only flow with NEW data flow library |
2729
| use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library |
@@ -176,6 +178,8 @@ flow
176178
| sanitizer-guards.js:91:11:91:18 | source() | sanitizer-guards.js:98:7:98:7 | x |
177179
| sanitizer-guards.js:91:11:91:18 | source() | sanitizer-guards.js:102:10:102:10 | x |
178180
| sanitizer-guards.js:91:11:91:18 | source() | sanitizer-guards.js:104:7:104:7 | x |
181+
| spread.js:4:15:4:22 | source() | spread.js:18:8:18:8 | y |
182+
| spread.js:4:15:4:22 | source() | spread.js:24:8:24:8 | y |
179183
| thisAssignments.js:4:17:4:24 | source() | thisAssignments.js:5:10:5:18 | obj.field |
180184
| thisAssignments.js:7:19:7:26 | source() | thisAssignments.js:8:10:8:20 | this.field2 |
181185
| tst.js:2:13:2:20 | source() | tst.js:4:10:4:10 | x |
+18-1Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1+
import 'dummy';
2+
13
function test() {
24
let taint = source();
3-
5+
46
sink({ ...taint }); // NOT OK
57
sink({ f: 'hello', ...taint, g: 'world' }); // NOT OK
68

79
sink([ ...taint ]); // NOT OK
810
sink([ 1, 2, ...taint, 3 ]); // NOT OK
11+
12+
fn1(...['x', taint, 'z']);
13+
fn2.apply(undefined, ['x', taint, 'z']);
14+
}
15+
16+
function fn1(x, y, z) {
17+
sink(x);
18+
sink(y); // NOT OK
19+
sink(z);
20+
}
21+
22+
function fn2(x, y, z) {
23+
sink(x);
24+
sink(y); // NOT OK
25+
sink(z);
926
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.