Skip to content

Commit 2f28155

Browse files
committed
fix(csp): allow https images in markdown preview and html sandbox
1 parent da09a2a commit 2f28155

2 files changed

Lines changed: 2 additions & 18 deletions

File tree

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/preview-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ const HTML_PREVIEW_CSP = [
734734
"default-src 'none'",
735735
"script-src 'unsafe-inline'",
736736
"style-src 'unsafe-inline'",
737-
'img-src data: blob:',
737+
"img-src 'self' https: data: blob:",
738738
'font-src data:',
739739
'media-src data: blob:',
740740
"connect-src 'none'",

apps/sim/lib/core/security/csp.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,7 @@ const STATIC_SCRIPT_SRC = [
6161
: []),
6262
] as const
6363

64-
const STATIC_IMG_SRC = [
65-
"'self'",
66-
'data:',
67-
'blob:',
68-
'https://*.googleusercontent.com',
69-
'https://*.google.com',
70-
'https://*.atlassian.com',
71-
'https://cdn.discordapp.com',
72-
'https://*.githubusercontent.com',
73-
'https://*.s3.amazonaws.com',
74-
'https://s3.amazonaws.com',
75-
'https://*.amazonaws.com',
76-
'https://*.blob.core.windows.net',
77-
'https://github.com/*',
78-
'https://cursor.com',
79-
...(isHosted ? ['https://www.googletagmanager.com', 'https://www.google-analytics.com'] : []),
80-
] as const
64+
const STATIC_IMG_SRC = ["'self'", 'data:', 'blob:', 'https:'] as const
8165

8266
const STATIC_CONNECT_SRC = [
8367
"'self'",

0 commit comments

Comments
 (0)