JS: Add test with route handler indirection

This commit is contained in:
Asger Feldthaus
2021-10-28 10:09:36 +02:00
parent 3cbe94ac0a
commit 7492293c5b
3 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1 @@
| query-tests/Security/CWE-073/routes.js:2 | expected an alert, but found none | NOT OK | |

View File

@@ -0,0 +1,3 @@
exports.foo = function(req, res) {
res.render('foo', req.body); // NOT OK
}

View File

@@ -27,4 +27,7 @@ function indirect(res, obj) {
res.render("template", str); // OK
res.render("template", JSON.parse(str)); // NOT OK
}
}
let routes = require('./routes');
app.post('/foo', routes.foo);