Skip to content

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

Address veria comment

Carlos Monastyrskib71c9ea38e6f
diff --git a/backend/src/services/pki-sync/pki-sync-service.ts b/backend/src/services/pki-sync/pki-sync-service.ts
index c4b0ce83dc..ab8a7dc211 100644
--- a/backend/src/services/pki-sync/pki-sync-service.ts
+++ b/backend/src/services/pki-sync/pki-sync-service.ts
@@ -434,6 +434,17 @@ export const pkiSyncServiceFactory = ({
const permissionFilters = await $certificateReadFilters(projectId, applicationId, actor);
if (!permissionFilters) return;
+ const growingKinds = PKI_SYNC_FILTER_KINDS.filter(
+ (kind) => kind !== "certificateOrderIds" && filters?.[kind] !== undefined
+ );
+
+ if (growingKinds.length > 0) {
+ throw new ForbiddenRequestError({
+ message:
+ "Certificate profile and metadata filters also take certificates issued later, so they need access to read every certificate in this Application. Name the certificates instead, or ask for broader access."
+ });
+ }
+
const scope = { projectId, applicationId };
const [matchedCount, readableCount] = await Promise.all([
certificateDAL.countCertificatesMatchingSyncFilters(filters, scope),
@@ -1293,6 +1304,7 @@ export const pkiSyncServiceFactory = ({
}
await $assertFilterProfilesInApplication(args.filters, args.applicationId);
+ await $assertActorCanReadFilterMatches(args.projectId, args.applicationId, args.filters, actor);
const connection = await appConnectionService.validateAppConnectionUsageById(
getPkiSyncConnectionApps(args.destination),