Skip to content

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

Fix: Validate approvers access

Daniel Hougaardcd6be68461ef
diff --git a/backend/src/ee/services/access-approval-policy/access-approval-policy-service.ts b/backend/src/ee/services/access-approval-policy/access-approval-policy-service.ts
index f5cce5db4b..f143808692 100644
--- a/backend/src/ee/services/access-approval-policy/access-approval-policy-service.ts
+++ b/backend/src/ee/services/access-approval-policy/access-approval-policy-service.ts
@@ -54,6 +54,7 @@ export const accessApprovalPolicyServiceFactory = ({
if (approvals > approvers.length)
throw new BadRequestError({ message: "Approvals cannot be greater than approvers" });
+ if (!secretPath) throw new BadRequestError({ message: "Secret path is required" });
const { permission } = await permissionService.getProjectPermission(
actor,
@@ -154,6 +155,7 @@ export const accessApprovalPolicyServiceFactory = ({
actorAuthMethod,
actorOrgId
);
+
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.SecretApproval);
const updatedPolicy = await accessApprovalPolicyDAL.transaction(async (tx) => {