From 4689edade0265276af76b98dffb40650fa54939e Mon Sep 17 00:00:00 2001 From: Pluto Date: Sat, 30 Nov 2024 11:12:45 +0530 Subject: [PATCH] fix: regex vulnerability causing quality gate failure --- src/extensionsIntegrated/CSSColorPreview/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extensionsIntegrated/CSSColorPreview/main.js b/src/extensionsIntegrated/CSSColorPreview/main.js index 97a07affd..09001b2ca 100644 --- a/src/extensionsIntegrated/CSSColorPreview/main.js +++ b/src/extensionsIntegrated/CSSColorPreview/main.js @@ -77,7 +77,8 @@ define(function (require, exports, module) { if ((lineText.indexOf('/*') !== -1) || (lineText.indexOf('*/') !== -1)) { continue; } else { - let regx = /:.*?;/g; + let regx = /:[^;]*;/g; + lineText = lineText.match(regx); if (lineText) { let tempColors = lineText[0].match(COLOR_REGEX);