Skip to content

Commit

Permalink
reduce Redos
Browse files Browse the repository at this point in the history
  • Loading branch information
fu351 committed Dec 15, 2023
1 parent 80cde88 commit 414d778
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion search.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ router.get('/package/byName/:name', async (req, res) => {
router.post('/package/byRegEx', async (req, res) => {
console.log('search by regex happening');
//get the regular expression from the bodys
const regEx = new RE2(req.body.RegEx);
const regEx = new RegExp(req.body.RegEx);
if (!safeRegex(RegExp(req.body.RegEx))) {
return res.status(400).json({error: 'The regular expression is potentially unsafe'});
}
Expand Down

0 comments on commit 414d778

Please sign in to comment.