mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Added test where RegExp. is used after matchAll but it not flagged as potential issue
This commit is contained in:
@@ -123,3 +123,8 @@ const serverMatchAll = http.createServer((req, res) => {
|
||||
let otherStr = username.matchAll(/.*/g)[0]; // BAD
|
||||
console.log(otherStr);
|
||||
});
|
||||
|
||||
const serverMatchAl2l = http.createServer((req, res) => {
|
||||
const result = url.parse(req.url, true).query.username.matchAll(/(\d+)/g); // BAD - match is marked as vulnerable, while matchAll is not.
|
||||
console.log("First captured group:", RegExp.$1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user