From 779542e8bd43d6a227a587cdc7ab6d28f8979d1a Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Thu, 29 Jan 2026 20:41:12 +0100 Subject: [PATCH] fix(notifications): validate name is not empty --- .../modules/notifications/notifications.service.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/server/modules/notifications/notifications.service.ts b/app/server/modules/notifications/notifications.service.ts index e0dd5467..3ae9f6a1 100644 --- a/app/server/modules/notifications/notifications.service.ts +++ b/app/server/modules/notifications/notifications.service.ts @@ -143,6 +143,10 @@ const createDestination = async (name: string, config: NotificationConfig) => { const organizationId = getOrganizationId(); const trimmedName = name.trim(); + if (trimmedName.length === 0) { + throw new InternalServerError("Name cannot be empty or whitespace-only"); + } + const encryptedConfig = await encryptSensitiveFields(config); const [created] = await db @@ -178,7 +182,11 @@ const updateDestination = async ( }; if (updates.name !== undefined) { - updateData.name = updates.name.trim(); + const trimmedName = updates.name.trim(); + if (trimmedName.length === 0) { + throw new InternalServerError("Name cannot be empty or whitespace-only"); + } + updateData.name = trimmedName; } if (updates.enabled !== undefined) {