Skip to content

Commit ba5cde1

Browse files
committed
fix(api): reserve additional browser policy headers
1 parent e0b0e22 commit ba5cde1

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎apps/sim/lib/workflows/response-security.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ describe('workflow HTTP response safety', () => {
4545
'Content-Security-Policy-Report-Only': 'report-uri /untrusted',
4646
'X-Frame-Options': 'ALLOWALL',
4747
'X-XSS-Protection': '0',
48+
'X-Download-Options': 'untrusted',
49+
'X-DNS-Prefetch-Control': 'on',
50+
'X-Permitted-Cross-Domain-Policies': 'all',
51+
'X-UA-Compatible': 'IE=7',
52+
'X-WebKit-CSP': "default-src * 'unsafe-inline'",
53+
'X-Content-Security-Policy': "default-src * 'unsafe-inline'",
54+
'Accept-CH': 'Sec-CH-UA-Model',
55+
'Accept-CH-Lifetime': '86400',
56+
'Critical-CH': 'Sec-CH-UA-Model',
57+
'Public-Key-Pins': 'max-age=0',
58+
'Public-Key-Pins-Report-Only': 'max-age=0; report-uri="/untrusted"',
4859
'Access-Control-Allow-Origin': '*',
4960
'Access-Control-Allow-Credentials': 'true',
5061
'Cross-Origin-Resource-Policy': 'cross-origin',

‎apps/sim/lib/workflows/utils.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ export const workflowHasResponseBlock = (
295295

296296
/** Headers that control the app origin or HTTP transport belong to the server. */
297297
const RESERVED_RESPONSE_HEADERS = new Set([
298+
'accept-ch',
299+
'accept-ch-lifetime',
298300
'alt-svc',
299301
'clear-site-data',
300302
'connection',
@@ -303,6 +305,7 @@ const RESERVED_RESPONSE_HEADERS = new Set([
303305
'content-length',
304306
'content-location',
305307
'content-range',
308+
'critical-ch',
306309
'document-policy',
307310
'keep-alive',
308311
'link',
@@ -311,6 +314,8 @@ const RESERVED_RESPONSE_HEADERS = new Set([
311314
'origin-agent-cluster',
312315
'permissions-policy',
313316
'proxy-authenticate',
317+
'public-key-pins',
318+
'public-key-pins-report-only',
314319
'referrer-policy',
315320
'refresh',
316321
'report-to',
@@ -322,8 +327,14 @@ const RESERVED_RESPONSE_HEADERS = new Set([
322327
'transfer-encoding',
323328
'upgrade',
324329
'www-authenticate',
330+
'x-content-security-policy',
331+
'x-dns-prefetch-control',
332+
'x-download-options',
325333
'x-frame-options',
334+
'x-permitted-cross-domain-policies',
326335
'x-sendfile',
336+
'x-ua-compatible',
337+
'x-webkit-csp',
327338
'x-xss-protection',
328339
])
329340

0 commit comments

Comments
 (0)