Skip to content

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

fix(clickhouse): re-check web access eligibility at connect

bernie-g4ee2cb805077
diff --git a/backend/src/ee/services/pam-web-access/pam-web-access-service.ts b/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
index 3f4ef4c302..0e62af9e95 100644
--- a/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
+++ b/backend/src/ee/services/pam-web-access/pam-web-access-service.ts
@@ -507,6 +507,11 @@ export const pamWebAccessServiceFactory = ({
}
const rawConnectionDetails = await decrypt(projectId, account.encryptedConnectionDetails);
+ // Re-checked here: the account can lose its HTTP port between ticket issue and connect.
+ const webAccessBlocked = webAccessUnavailableReason(account.accountType as PamAccountType, rawConnectionDetails);
+ if (webAccessBlocked) {
+ throw new BadRequestError({ message: webAccessBlocked });
+ }
const gatewayTarget = await extractGatewayTarget(account.accountType as PamAccountType, rawConnectionDetails);
const targetHost = selectedHost || gatewayTarget.host;
const credentials = await decrypt(projectId, account.encryptedCredentials);