Skip to content

Commit 60b24a8

Browse files
committed
JS: Use an actual sanitizer in test
We got a spurious alert on the following line because 'isLocalURL' is not defined and we don't rely on heuristic name-guessing for sanitisers anymore. This restores the intended behaviour of the test but with an actual sanitiser.
1 parent ca68c8a commit 60b24a8

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.get('/some/other/path2', function(req, res) {
2323

2424
app.get('/some/path', function(req, res) {
2525
var target = req.param("target");
26-
if (isLocalURL(target))
26+
if (target.startsWith("https://example.com/"))
2727
// OK - request parameter is sanitized before incorporating it into the redirect
2828
res.redirect(target);
2929
else

0 commit comments

Comments
 (0)