From 414d778ebd08537b63a9d613c92c7a4a76b9fba7 Mon Sep 17 00:00:00 2001 From: fu351 <122320084+fu351@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:34:22 -0500 Subject: [PATCH] reduce Redos --- search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search.js b/search.js index 046b1a7b..4378006e 100644 --- a/search.js +++ b/search.js @@ -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'}); }