Skip to content

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

feat: addressed review comments

=d2f3ec094c7c
diff --git a/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts b/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts
index 7fb452f1eb..873002eb83 100644
--- a/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts
+++ b/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts
@@ -592,7 +592,15 @@ export const registerAiMcpEndpointRouter = async (server: FastifyZodProvider) =>
endpointId: z.string().uuid().trim().min(1)
}),
body: z.object({
- redirect_uris: z.array(z.string()),
+ redirect_uris: z.array(
+ z
+ .string()
+ .url()
+ .refine(
+ (uri) => uri.startsWith("https://") || uri.startsWith("http://"),
+ "Redirect URI must start with https:// or http://"
+ )
+ ),
token_endpoint_auth_method: z.string(),
grant_types: z.array(z.string()),
response_types: z.array(z.string()),
diff --git a/backend/src/ee/services/secret-scanning-v2/bitbucket/bitbucket-secret-scanning-service.ts b/backend/src/ee/services/secret-scanning-v2/bitbucket/bitbucket-secret-scanning-service.ts
index 0a2d52e410..b1ec152b4b 100644
--- a/backend/src/ee/services/secret-scanning-v2/bitbucket/bitbucket-secret-scanning-service.ts
+++ b/backend/src/ee/services/secret-scanning-v2/bitbucket/bitbucket-secret-scanning-service.ts
@@ -70,12 +70,12 @@ export const bitbucketSecretScanningService = (
hmac.update(bodyString);
const calculatedSignature = hmac.digest("hex");
+ const calculatedSignatureBuf = Buffer.from(calculatedSignature, "hex");
+ const receivedSignatureBuf = Buffer.from(receivedSignature, "hex");
+
const isValid =
- calculatedSignature.length === receivedSignature.length &&
- crypto.nativeCrypto.timingSafeEqual(
- Buffer.from(calculatedSignature, "hex"),
- Buffer.from(receivedSignature, "hex")
- );
+ calculatedSignatureBuf.byteLength === receivedSignatureBuf.byteLength &&
+ crypto.nativeCrypto.timingSafeEqual(calculatedSignatureBuf, receivedSignatureBuf);
if (!isValid) {
logger.error(
diff --git a/backend/src/ee/services/secret-scanning-v2/gitlab/gitlab-secret-scanning-factory.ts b/backend/src/ee/services/secret-scanning-v2/gitlab/gitlab-secret-scanning-factory.ts
index ef40ab795a..13c22d4030 100644
--- a/backend/src/ee/services/secret-scanning-v2/gitlab/gitlab-secret-scanning-factory.ts
+++ b/backend/src/ee/services/secret-scanning-v2/gitlab/gitlab-secret-scanning-factory.ts
@@ -260,7 +260,7 @@ export const GitLabSecretScanningFactory = ({ appConnectionDAL, kmsService }: TS
throw new Error("Invalid GitLab project name");
}
- const validatedHostname = new URL(instanceUrl).hostname;
+ const validatedHostname = new URL(instanceUrl).host;
await cloneRepository({
cloneUrl: `https://${user.username}:${connection.credentials.accessToken}@${validatedHostname}/${resourceName}.git`,
diff --git a/backend/src/server/routes/v1/integration-router.ts b/backend/src/server/routes/v1/integration-router.ts
index f5cfa11994..f7954b7a19 100644
--- a/backend/src/server/routes/v1/integration-router.ts
+++ b/backend/src/server/routes/v1/integration-router.ts
@@ -53,7 +53,7 @@ export const registerIntegrationRouter = async (server: FastifyZodProvider) => {
targetService: z.string().trim().optional().describe(INTEGRATION.CREATE.targetService),
targetServiceId: z.string().trim().optional().describe(INTEGRATION.CREATE.targetServiceId),
owner: z.string().trim().optional().describe(INTEGRATION.CREATE.owner),
- url: z.string().url().trim().optional().describe(INTEGRATION.CREATE.url),
+ url: z.string().trim().url().optional().describe(INTEGRATION.CREATE.url),
path: z.string().trim().optional().describe(INTEGRATION.CREATE.path),
region: z.string().trim().optional().describe(INTEGRATION.CREATE.region),
scope: z.string().trim().optional().describe(INTEGRATION.CREATE.scope),