From 00f5cad69fc8852b9dac6475538eebe90395cf2e Mon Sep 17 00:00:00 2001 From: Aishwarya Date: Mon, 22 Jun 2026 18:04:12 +0530 Subject: [PATCH] fix: sanitize filename before processing in upload route --- upload-api/src/routes/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upload-api/src/routes/index.ts b/upload-api/src/routes/index.ts index d6157c24d..16e187161 100644 --- a/upload-api/src/routes/index.ts +++ b/upload-api/src/routes/index.ts @@ -373,7 +373,8 @@ router.get( return res.send('Filename could not be determined from the local path.'); } - const name = fileName?.split?.('.')?.[0]; + + const name = sanitizeFilename(fileName?.split?.('.')?.[0] ?? ''); const fileExt = fileName?.split('.')?.pop() ?? ''; const bodyStream = createReadStream(localPath);