Skip to content

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

fix security issues

Matheus Nogueira44f547d2f9ae
diff --git a/backend/src/services/secret-sync/secret-sync-maps.ts b/backend/src/services/secret-sync/secret-sync-maps.ts
index 6e11643a48..bc9fa76cd3 100644
--- a/backend/src/services/secret-sync/secret-sync-maps.ts
+++ b/backend/src/services/secret-sync/secret-sync-maps.ts
@@ -215,7 +215,7 @@ const defaultDuplicateCheck: DestinationDuplicateCheckFn = () => true;
export const DESTINATION_DUPLICATE_CHECK_MAP: Record<SecretSync, DestinationDuplicateCheckFn> = {
[SecretSync.AWSParameterStore]: defaultDuplicateCheck,
- [SecretSync.AWSSecretsManager]: (_existingConfig, _newConfig, existingConnectionId, newConnectionId) => {
+ [SecretSync.AWSSecretsManager]: ({ existingConnectionId, newConnectionId }) => {
// TODO: we should also check the AWS account id here, otherwise
// two connections to the same account would cause issues.
// If assume role: get account id from ARN
@@ -241,7 +241,7 @@ export const DESTINATION_DUPLICATE_CHECK_MAP: Record<SecretSync, DestinationDupl
[SecretSync.Render]: defaultDuplicateCheck,
[SecretSync.Flyio]: defaultDuplicateCheck,
[SecretSync.TriggerDev]: defaultDuplicateCheck,
- [SecretSync.GitLab]: (existingConfig, newConfig) => {
+ [SecretSync.GitLab]: ({ existingConfig, newConfig }) => {
const existingTargetEnv = existingConfig.targetEnvironment as string | undefined;
const newTargetEnv = newConfig.targetEnvironment as string | undefined;
diff --git a/backend/src/services/secret-sync/secret-sync-service.ts b/backend/src/services/secret-sync/secret-sync-service.ts
index 50a135d067..91dd0218d1 100644
--- a/backend/src/services/secret-sync/secret-sync-service.ts
+++ b/backend/src/services/secret-sync/secret-sync-service.ts
@@ -288,12 +288,12 @@ export const secretSyncServiceFactory = ({
try {
const baseFieldsMatch = deepEqualSkipFields(sync.destinationConfig, destinationConfig, skipFields);
if (baseFieldsMatch) {
- return DESTINATION_DUPLICATE_CHECK_MAP[destination](
- sync.destinationConfig as Record<string, unknown>,
- destinationConfig,
- sync.connectionId,
- connectionId ?? null
- );
+ return DESTINATION_DUPLICATE_CHECK_MAP[destination]({
+ existingConfig: sync.destinationConfig as Record<string, unknown>,
+ newConfig: destinationConfig,
+ existingConnectionId: sync.connectionId,
+ newConnectionId: connectionId ?? null
+ });
}
return false;
} catch {
@@ -506,7 +506,7 @@ export const secretSyncServiceFactory = ({
{
destination,
destinationConfig: params.destinationConfig,
- connectionId: connectionId ?? secretSync.connectionId,
+ connectionId: params.connectionId ?? connectionId,
projectId: secretSync.projectId,
excludeSyncId: secretSync.id
},
diff --git a/backend/src/services/secret-sync/secret-sync-types.ts b/backend/src/services/secret-sync/secret-sync-types.ts
index 2709ddfa4c..f116aa79e8 100644
--- a/backend/src/services/secret-sync/secret-sync-types.ts
+++ b/backend/src/services/secret-sync/secret-sync-types.ts
@@ -570,12 +570,12 @@ export type TSecretMap = Record<
}
>;
-export type DestinationDuplicateCheckFn = (
- existingConfig: Record<string, unknown>,
- newConfig: Record<string, unknown>,
- existingConnectionId: string | null,
- newConnectionId: string | null
-) => boolean;
+export type DestinationDuplicateCheckFn = (opts: {
+ existingConfig: Record<string, unknown>;
+ newConfig: Record<string, unknown>;
+ existingConnectionId: string | null;
+ newConnectionId: string | null;
+}) => boolean;
export type TPreSaveTransformDeps = {
secretV2BridgeDAL: Pick<TSecretV2BridgeDALFactory, "findOne">;