Skip to content

Commit cd99d6a

Browse files
committed
JS: Fix some mistranslated OK-style comments and match actual query output
1 parent 63e37b9 commit cd99d6a

File tree

2 files changed

+2
-2
lines changed
  • javascript/ql/test/query-tests/Security/CWE-601

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function foo() {
22
var url = document.location.toString();
3-
window.location = url.substring(0).substring(1); // OK [INCONSISTENCY] - but not important
3+
window.location = url.substring(0).substring(1); // $ SPURIOUS: Alert - but not important
44
window.location = url.substring(0, 10).substring(1); // $ SPURIOUS: Alert
55
window.location = url.substring(0, url.indexOf('/', 10)).substring(1); // $ SPURIOUS: Alert
66

javascript/ql/test/query-tests/Security/CWE-601/ServerSideUrlRedirect/koa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ app.use(async ctx => {
1717
if(!url || isCrossDomainRedirect || url.match(VALID)) {
1818
ctx.redirect('/');
1919
} else {
20-
ctx.redirect(url); // possibly OK - flagged anyway
20+
ctx.redirect(url); // $ Alert - possibly OK but flagged anyway
2121
}
2222

2323
if(!url || isCrossDomainRedirect || url.match(/[^\w/-]/)) {

0 commit comments

Comments
 (0)