Skip to content

Commit 1b8fa20

Browse files
committed
JS: Accept a spurious alert
Unlike the previous case 'isLocalUrl' actually resolves to a function in this case, but we don't recognise the sanitiser used in it. Fixing it is out of scope for this PR.
1 parent 6277e02 commit 1b8fa20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ app.get("/redirect", function (req, res) {
1515
// OK - check that we don't redirect to a different host
1616
let target = req.query["target"];
1717
if (isLocalUrl(target)) {
18-
res.redirect(target);
18+
res.redirect(target); // $ SPURIOUS: Alert - sanitiser not recognised
1919
} else {
2020
res.redirect("/");
2121
}

0 commit comments

Comments
 (0)