From 0ad98a0c29e045e66187efde068c0746701f2188 Mon Sep 17 00:00:00 2001 From: Henry Heng Date: Thu, 6 Nov 2025 14:28:14 +0000 Subject: [PATCH] Update packages/server/src/utils/createAttachment.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- packages/server/src/utils/createAttachment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/utils/createAttachment.ts b/packages/server/src/utils/createAttachment.ts index 9e9228f15..10495140d 100644 --- a/packages/server/src/utils/createAttachment.ts +++ b/packages/server/src/utils/createAttachment.ts @@ -32,7 +32,7 @@ export const createFileAttachment = async (req: Request) => { if (!chatflowid || !isValidUUID(chatflowid)) { throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid chatflowId format - must be a valid UUID') } - if (isPathTraversal(chatflowid) || isPathTraversal(chatId)) { + if (isPathTraversal(chatflowid) || (chatId && isPathTraversal(chatId))) { throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'Invalid path characters detected') }