Skip to content

Commit 8f58685

Browse files
authored
Merge pull request #14643 from aibaars/express-req-path
Javascript: add `req.path` as remote flow source
2 parents b9dfeb3 + 5cc94e1 commit 8f58685

File tree

3 files changed

+2963
-2880
lines changed

3 files changed

+2963
-2880
lines changed

javascript/ql/lib/semmle/javascript/frameworks/Express.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,10 @@ module Express {
618618
or
619619
kind = "body" and
620620
this = ref.getAPropertyRead("body")
621+
or
622+
// `req.path`
623+
kind = "url" and
624+
this = ref.getAPropertyRead("path")
621625
)
622626
}
623627

javascript/ql/test/library-tests/frameworks/Express/src/express.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,9 @@ app.get('/some/non-xss1', function(req, res) {
6767
res.send(req.params.foo)
6868
foo(res);
6969
});
70+
71+
app.get('/some/xss3', function(req, res) {
72+
res.header("Content-Type", "text/html");
73+
res.send(req.path)
74+
foo(res);
75+
});

0 commit comments

Comments
 (0)