From 33c3a4ed4e237e61f740714f1599ade9ace13963 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 17 Feb 2026 18:11:43 -0600 Subject: [PATCH] fix(validation): enhance isValidSearch function to restrict allowed characters - Updated the regex in the isValidSearch function to limit valid characters, improving input validation and security against potential injection attacks. --- apps/dokploy/server/wss/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/server/wss/utils.ts b/apps/dokploy/server/wss/utils.ts index f6748feff..52b65e65d 100644 --- a/apps/dokploy/server/wss/utils.ts +++ b/apps/dokploy/server/wss/utils.ts @@ -41,7 +41,9 @@ export const isValidSince = (since: string): boolean => { * Max length 500. */ export const isValidSearch = (search: string): boolean => { - return /^[\x20-\x7E]{0,500}$/.test(search); + return /^[\x20-\x21\x23-\x25\x27-\x28\x2A-\x3A\x3D\x3F-\x5B\x5D-\x7B\x7D-\x7E]{0,500}$/.test( + search, + ); }; /**