From a4eafdb1355e9376bc8bcd9fd3a021ce3e9705a6 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sat, 14 Nov 2026 14:02:17 -0800 Subject: [PATCH] fix(csp): remove shadowed permissive policy from workflow execute routes The execute routes' CSP entry was always overridden by the later catch-all header rule (Next applies the last matching rule per key), so the default-src * policy was never served. Delete it so the config reflects the policy actually in effect; COEP/COOP on those routes are unchanged. --- apps/sim/lib/core/security/csp.ts | 7 ------- apps/sim/next.config.ts | 9 --------- 2 files changed, 16 deletions(-) diff --git a/apps/sim/lib/core/security/csp.ts b/apps/sim/lib/core/security/csp.ts index 77c90decc36..12a7f840935 100644 --- a/apps/sim/lib/core/security/csp.ts +++ b/apps/sim/lib/core/security/csp.ts @@ -319,13 +319,6 @@ export function getMainCSPPolicy(): string { return buildCSPString(buildTimeCSPDirectives) } -/** - * Permissive CSP for workflow execution endpoints - */ -export function getWorkflowExecutionCSPPolicy(): string { - return "default-src * 'unsafe-inline' 'unsafe-eval'; connect-src *;" -} - /** * CSP for embeddable chat pages. * Extends the shared embed policy with Microsoft Office.js sources so the diff --git a/apps/sim/next.config.ts b/apps/sim/next.config.ts index 4ef51dac3f8..29ff064d278 100644 --- a/apps/sim/next.config.ts +++ b/apps/sim/next.config.ts @@ -7,7 +7,6 @@ import { FILE_DELIVERY_CSP_PATH_PATTERN, getChatEmbedCSPPolicy, getMainCSPPolicy, - getWorkflowExecutionCSPPolicy, } from './lib/core/security/csp' import { LANDING_ROUTES } from './lib/landing/routes' import { LIBRARY_MERGED_SLUGS, LIBRARY_MOVED_BLOG_SLUGS } from './lib/library/retired-slugs' @@ -326,10 +325,6 @@ const nextConfig: NextConfig = { headers: [ { key: 'Cross-Origin-Embedder-Policy', value: 'unsafe-none' }, { key: 'Cross-Origin-Opener-Policy', value: 'unsafe-none' }, - { - key: 'Content-Security-Policy', - value: getWorkflowExecutionCSPPolicy(), - }, ], }, { @@ -337,10 +332,6 @@ const nextConfig: NextConfig = { headers: [ { key: 'Cross-Origin-Embedder-Policy', value: 'unsafe-none' }, { key: 'Cross-Origin-Opener-Policy', value: 'unsafe-none' }, - { - key: 'Content-Security-Policy', - value: getWorkflowExecutionCSPPolicy(), - }, ], }, {