fix(core)!: Use CSP header to sandbox html webhooks instead of iframe (#18602)

This commit is contained in:
Tomi Turtiainen
2025-08-21 11:39:57 +03:00
committed by GitHub
parent 60670e1e40
commit 667656e8f3
11 changed files with 66 additions and 626 deletions

View File

@@ -39,7 +39,10 @@ export class SecurityConfig {
@Env('N8N_CONTENT_SECURITY_POLICY_REPORT_ONLY')
contentSecurityPolicyReportOnly: boolean = false;
/** Whether to disable iframe sandboxing for webhooks */
/**
* Whether to disable HTML sandboxing for webhooks. The sandboxing mechanism uses CSP headers now,
* but the name is kept for backwards compatibility.
*/
@Env('N8N_INSECURE_DISABLE_WEBHOOK_IFRAME_SANDBOX')
disableIframeSandboxing: boolean = false;
disableWebhookHtmlSandboxing: boolean = false;
}

View File

@@ -299,7 +299,7 @@ describe('GlobalConfig', () => {
daysAbandonedWorkflow: 90,
contentSecurityPolicy: '{}',
contentSecurityPolicyReportOnly: false,
disableIframeSandboxing: false,
disableWebhookHtmlSandboxing: false,
},
executions: {
pruneData: true,