From 03df9a23a7a2e664d131b94925f8dcbe257cca38 Mon Sep 17 00:00:00 2001 From: petruki <31597636+petruki@users.noreply.github.com> Date: Sun, 29 Jan 2023 18:24:25 -0800 Subject: [PATCH] Fixed remaining reDoS vulnerabilities --- src/models/config-strategy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/config-strategy.js b/src/models/config-strategy.js index e74b160..4751cde 100644 --- a/src/models/config-strategy.js +++ b/src/models/config-strategy.js @@ -270,9 +270,9 @@ async function processREGEX(operation, input, values) { case OperationsType.NOT_EXIST: return !(await processREGEX(OperationsType.EXIST, input, values)); case OperationsType.EQUAL: - return input.match(`\\b${values[0]}\\b`) != null; + return await tryMatch([`\\b${values[0]}\\b`], input); case OperationsType.NOT_EQUAL: - return input.match(`\\b${values[0]}\\b`) == null; + return !(await tryMatch([`\\b${values[0]}\\b`], input)); } }