From 9dcafb11c896b25d90e2142e06cb7c9c565e39a6 Mon Sep 17 00:00:00 2001 From: Ilya Bondar Date: Mon, 8 Apr 2024 11:34:16 +0200 Subject: [PATCH] fix(chat): disallow TAB and ASCII control symbols (Issue #1212) (#1214) --- apps/chat/src/utils/app/file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/chat/src/utils/app/file.ts b/apps/chat/src/utils/app/file.ts index ea99023e4d..e56586f053 100644 --- a/apps/chat/src/utils/app/file.ts +++ b/apps/chat/src/utils/app/file.ts @@ -105,7 +105,7 @@ export const getFilesWithInvalidFileType = ( ? [] : files.filter((file) => !isAllowedMimeType(allowedFileTypes, file.type)); }; -export const notAllowedSymbols = ':;,=/{}%&\\'; +export const notAllowedSymbols = ':;,=/{}%&\\\t\x00-\x1F'; export const notAllowedSymbolsRegex = new RegExp( `[${escapeRegExp(notAllowedSymbols)}]|(\r\n|\n|\r|\t)`, 'gm',