From 0593c71d4350f4802c513601239c640900a3a830 Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Tue, 11 Nov 2025 12:26:19 -0800 Subject: [PATCH] Fix the compare logic, isSubsetOf seems like not available --- backend/src/ee/services/pki-acme/pki-acme-service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/ee/services/pki-acme/pki-acme-service.ts b/backend/src/ee/services/pki-acme/pki-acme-service.ts index e3b366d5b..4958308e1 100644 --- a/backend/src/ee/services/pki-acme/pki-acme-service.ts +++ b/backend/src/ee/services/pki-acme/pki-acme-service.ts @@ -684,12 +684,11 @@ export const pkiAcmeServiceFactory = ({ .map((san) => san.value.toLowerCase()) .concat([certificateRequest.commonName!.toLowerCase()]) ); - const expectedIdentifierValues = new Set( - orderWithAuthorizations.authorizations.map((auth) => auth.identifierValue.toLowerCase()) - ); if ( - csrIdentifierValues.size != expectedIdentifierValues.size || - !csrIdentifierValues.isSubsetOf(expectedIdentifierValues) + csrIdentifierValues.size !== orderWithAuthorizations.authorizations.length || + !orderWithAuthorizations.authorizations.every((auth) => + csrIdentifierValues.has(auth.identifierValue.toLowerCase()) + ) ) { throw new AcmeBadCSRError({ detail: "Invalid CSR: Common name + SANs mismatch with order identifiers" }); }