Skip to content

Commit fa255f3

Browse files
committed
add test for self.importScripts(..)
1 parent cc5109d commit fa255f3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

javascript/ql/test/query-tests/Security/CWE-601/ClientSideUrlRedirect/ClientSideUrlRedirect.expected

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ nodes
117117
| tst13.js:49:32:49:32 | e |
118118
| tst13.js:50:23:50:23 | e |
119119
| tst13.js:50:23:50:23 | e |
120+
| tst13.js:52:34:52:34 | e |
121+
| tst13.js:52:34:52:34 | e |
122+
| tst13.js:53:28:53:28 | e |
123+
| tst13.js:53:28:53:28 | e |
120124
| tst.js:2:19:2:69 | /.*redi ... n.href) |
121125
| tst.js:2:19:2:72 | /.*redi ... ref)[1] |
122126
| tst.js:2:19:2:72 | /.*redi ... ref)[1] |
@@ -242,6 +246,10 @@ edges
242246
| tst13.js:49:32:49:32 | e | tst13.js:50:23:50:23 | e |
243247
| tst13.js:49:32:49:32 | e | tst13.js:50:23:50:23 | e |
244248
| tst13.js:49:32:49:32 | e | tst13.js:50:23:50:23 | e |
249+
| tst13.js:52:34:52:34 | e | tst13.js:53:28:53:28 | e |
250+
| tst13.js:52:34:52:34 | e | tst13.js:53:28:53:28 | e |
251+
| tst13.js:52:34:52:34 | e | tst13.js:53:28:53:28 | e |
252+
| tst13.js:52:34:52:34 | e | tst13.js:53:28:53:28 | e |
245253
| tst.js:2:19:2:69 | /.*redi ... n.href) | tst.js:2:19:2:72 | /.*redi ... ref)[1] |
246254
| tst.js:2:19:2:69 | /.*redi ... n.href) | tst.js:2:19:2:72 | /.*redi ... ref)[1] |
247255
| tst.js:2:47:2:63 | document.location | tst.js:2:47:2:68 | documen ... on.href |
@@ -285,5 +293,6 @@ edges
285293
| tst13.js:40:15:40:21 | payload | tst13.js:2:19:2:35 | document.location | tst13.js:40:15:40:21 | payload | Untrusted URL redirection due to $@. | tst13.js:2:19:2:35 | document.location | user-provided value |
286294
| tst13.js:44:14:44:20 | payload | tst13.js:2:19:2:35 | document.location | tst13.js:44:14:44:20 | payload | Untrusted URL redirection due to $@. | tst13.js:2:19:2:35 | document.location | user-provided value |
287295
| tst13.js:50:23:50:23 | e | tst13.js:49:32:49:32 | e | tst13.js:50:23:50:23 | e | Untrusted URL redirection due to $@. | tst13.js:49:32:49:32 | e | user-provided value |
296+
| tst13.js:53:28:53:28 | e | tst13.js:52:34:52:34 | e | tst13.js:53:28:53:28 | e | Untrusted URL redirection due to $@. | tst13.js:52:34:52:34 | e | user-provided value |
288297
| tst.js:2:19:2:72 | /.*redi ... ref)[1] | tst.js:2:47:2:63 | document.location | tst.js:2:19:2:72 | /.*redi ... ref)[1] | Untrusted URL redirection due to $@. | tst.js:2:47:2:63 | document.location | user-provided value |
289298
| tst.js:6:20:6:59 | indirec ... ref)[1] | tst.js:6:34:6:50 | document.location | tst.js:6:20:6:59 | indirec ... ref)[1] | Untrusted URL redirection due to $@. | tst.js:6:34:6:50 | document.location | user-provided value |

javascript/ql/test/query-tests/Security/CWE-601/ClientSideUrlRedirect/tst13.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@ function foo() {
4949
self.onmessage = function (e) {
5050
importScripts(e); // NOT OK
5151
}
52+
window.onmessage = function (e) {
53+
self.importScripts(e); // NOT OK
54+
}
5255
})();

0 commit comments

Comments
 (0)