Skip to content

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

fix(external-infisical): block local/private IPs in sync fns

Igor Correa6552ce70dc91
diff --git a/backend/src/services/secret-sync/external-infisical/external-infisical-sync-fns.ts b/backend/src/services/secret-sync/external-infisical/external-infisical-sync-fns.ts
index a9d160c94e..5d9ef627ee 100644
--- a/backend/src/services/secret-sync/external-infisical/external-infisical-sync-fns.ts
+++ b/backend/src/services/secret-sync/external-infisical/external-infisical-sync-fns.ts
@@ -2,6 +2,7 @@
import { AxiosError } from "axios";
import { request } from "@app/lib/config/request";
+import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";
import { getExternalInfisicalAccessToken } from "@app/services/app-connection/external-infisical";
import { SecretSyncError } from "@app/services/secret-sync/secret-sync-errors";
import { matchesSchema, parseSyncErrorMessage } from "@app/services/secret-sync/secret-sync-fns";
@@ -43,6 +44,7 @@ type TRemoteContext = {
const getRemoteContext = async (secretSync: TExternalInfisicalSyncWithCredentials): Promise<TRemoteContext> => {
const { credentials } = secretSync.connection;
+ await blockLocalAndPrivateIpAddresses(credentials.instanceUrl);
const accessToken = await getExternalInfisicalAccessToken(credentials);
const baseUrl = credentials.instanceUrl.replace(/\/$/, "");
return { accessToken, baseUrl };