Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat(secret-sync): validate secret names using SecretNameSchema before processing
Victor Santos761a8984846e
diff --git a/backend/src/services/secret-sync/secret-sync-queue.ts b/backend/src/services/secret-sync/secret-sync-queue.tsindex 63faf3b037..4b28564c01 100644--- a/backend/src/services/secret-sync/secret-sync-queue.ts+++ b/backend/src/services/secret-sync/secret-sync-queue.ts@@ -63,6 +63,7 @@ import { TAppConnectionDALFactory } from "../app-connection/app-connection-dal";import { TFolderCommitServiceFactory } from "../folder-commit/folder-commit-service";import { TNotificationServiceFactory } from "../notification/notification-service";import { NotificationType } from "../notification/notification-types";+import { SecretNameSchema } from "@app/server/lib/schemas";export type TSecretSyncQueueFactory = ReturnType<typeof secretSyncQueueFactory>;@@ -408,6 +409,14 @@ export const secretSyncQueueFactory = ({if (!Object.keys(importedSecrets).length) return {};+ for (const [key] of Object.entries(importedSecrets)) {+ const result = SecretNameSchema.safeParse(key);+ if (!result.success) {+ const errorMessage = result.error.issues[0]?.message || "Invalid secret name";+ throw new Error(`Invalid secret name "${key}": ${errorMessage}`);+ }+ }+const importedSecretMap: TSecretMap = {};const secretMap = await $getInfisicalSecrets(secretSync, false);