security fix

This commit is contained in:
Moyasee
2025-09-19 17:15:59 +03:00
parent f4e84e46cc
commit 672ddff9f8
7 changed files with 31 additions and 17 deletions

View File

@@ -69,8 +69,9 @@ app.whenReady().then(async () => {
request.url.slice("gradient:".length)
);
// Fixed regex to prevent ReDoS - removed nested quantifiers and backtracking
const match = gradientCss.match(
/linear-gradient\(([^,]+),\s*([^,]+),\s*([^)]+)\)/
/^linear-gradient\(([^,()]+),\s*([^,()]+),\s*([^,()]+)\)$/
);
let direction = "45deg";