Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

update verifyHostInputValidity

Maidul Islamde420fd02cf8
diff --git a/backend/src/ee/services/dynamic-secret/dynamic-secret-fns.ts b/backend/src/ee/services/dynamic-secret/dynamic-secret-fns.ts
index ac6a66d3ba..3bd409faf2 100644
--- a/backend/src/ee/services/dynamic-secret/dynamic-secret-fns.ts
+++ b/backend/src/ee/services/dynamic-secret/dynamic-secret-fns.ts
@@ -24,7 +24,7 @@ export const verifyHostInputValidity = (host: string, isGateway = false) => {
if (
host === "localhost" ||
host === "127.0.0.1" ||
- crypto.timingSafeEqual(Buffer.from(dbHost || ""), Buffer.from(host))
+ (dbHost?.length === host.length && crypto.timingSafeEqual(Buffer.from(dbHost || ""), Buffer.from(host)))
) {
throw new BadRequestError({ message: "Invalid db host" });
}