Skip to content

Commit 345a8de

Browse files
committed
🔒fix polynomial regex in logs
1 parent 8ce5961 commit 345a8de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controlpanel/api/services/logs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ module.exports = {
130130
if (log.log.length > 1500) {
131131
errors.push({ log, error: '.log attribute is too long' });
132132
}
133-
const matchLog = log.log.match(/^cad-filter:\s*(?<log>[^!\s]+).*$/);
133+
// Updated regular expression to remove ambiguity and ensure efficient matching
134+
const matchLog = log.log.match(/^cad-filter:\s*(?<log>[^"\s]+).*$/);
134135
if (matchLog != null) log.log = matchLog.groups.log;
135136
if (!isJSON(log.log)) {
136137
errors.push({ log, error: '.log attribute is not a JSON' });

0 commit comments

Comments
 (0)