mirror of
https://github.com/github/codeql.git
synced 2026-04-25 00:35:20 +02:00
JS: previously js/case-sensitive-middleware-path was not taking into consideration unknown flags
This commit is contained in:
@@ -65,7 +65,7 @@ predicate isCaseSensitiveMiddleware(
|
||||
arg = call.getArgument(0) and
|
||||
regexp.getAReference().flowsTo(arg) and
|
||||
exists(string flags |
|
||||
flags = regexp.getFlags() and
|
||||
flags = regexp.tryGetFlags() and
|
||||
not RegExp::isIgnoreCase(flags)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -6,3 +6,4 @@
|
||||
| tst.js:76:9:76:20 | /\\/baz\\/bla/ | This route uses a case-sensitive path $@, but is guarding a $@. A path such as '/BAZ/BLA' will bypass the middleware. | tst.js:76:9:76:20 | /\\/baz\\/bla/ | pattern | tst.js:77:1:79:2 | app.get ... });\\n}) | case-insensitive path |
|
||||
| tst.js:86:9:86:30 | /\\/[Bb] ... 3\\/[a]/ | This route uses a case-sensitive path $@, but is guarding a $@. A path such as '/BAZ3/A' will bypass the middleware. | tst.js:86:9:86:30 | /\\/[Bb] ... 3\\/[a]/ | pattern | tst.js:87:1:89:2 | app.get ... });\\n}) | case-insensitive path |
|
||||
| tst.js:91:9:91:40 | /\\/summ ... ntGame/ | This route uses a case-sensitive path $@, but is guarding a $@. A path such as '/CURRENTGAME' will bypass the middleware. | tst.js:91:9:91:40 | /\\/summ ... ntGame/ | pattern | tst.js:93:1:95:2 | app.get ... O");\\n}) | case-insensitive path |
|
||||
| tst.js:98:5:98:43 | new Reg ... Flag()) | This route uses a case-sensitive path $@, but is guarding a $@. A path such as '/BAR/1' will bypass the middleware. | tst.js:98:5:98:43 | new Reg ... Flag()) | pattern | tst.js:107:1:108:2 | app.get ... ware\\n}) | case-insensitive path |
|
||||
|
||||
@@ -95,7 +95,7 @@ app.get('/currentGame', function (req, res) {
|
||||
});
|
||||
|
||||
app.get(
|
||||
new RegExp('^/bar(.*)?', unknownFlag()), // NOT OK - Currently not flagged.
|
||||
new RegExp('^/bar(.*)?', unknownFlag()), // NOT OK - Might be OK if the unknown flag evaluates to case insensitive one
|
||||
unknown(),
|
||||
function(req, res, next) {
|
||||
if (req.params.blah) {
|
||||
|
||||
Reference in New Issue
Block a user