Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: extensions/common/manifest_handlers/csp_info.cc

Issue 1184353002: Explicitly whitelist 'blob:' and 'filesystem:' in extensions' default CSP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest_handlers/csp_info.cc
diff --git a/extensions/common/manifest_handlers/csp_info.cc b/extensions/common/manifest_handlers/csp_info.cc
index e75699525515fceeb88bf7a81e719c1468e96345..c86f2c183dd8fd5b43c97a44ce8bb505462424b9 100644
--- a/extensions/common/manifest_handlers/csp_info.cc
+++ b/extensions/common/manifest_handlers/csp_info.cc
@@ -24,20 +24,25 @@ using csp_validator::SanitizeContentSecurityPolicy;
namespace {
const char kDefaultContentSecurityPolicy[] =
- "script-src 'self' chrome-extension-resource:; object-src 'self';";
+ "script-src 'self' blob: filesystem: chrome-extension-resource:; "
+ "object-src 'self' blob: filesystem:;";
#define PLATFORM_APP_LOCAL_CSP_SOURCES \
- "'self' data: chrome-extension-resource:"
+ "'self' blob: filesystem: data: chrome-extension-resource:"
const char kDefaultPlatformAppContentSecurityPolicy[] =
// Platform apps can only use local resources by default.
- "default-src 'self' chrome-extension-resource:;"
+ "default-src 'self' blob: filesystem: chrome-extension-resource:;"
Finnur 2015/06/16 13:20:01 This sounds like a reasonable approach if blob: an
// For remote resources, they can fetch them via XMLHttpRequest.
" connect-src *;"
// And serve them via data: or same-origin (blob:, filesystem:) URLs
- " style-src " PLATFORM_APP_LOCAL_CSP_SOURCES " 'unsafe-inline';"
- " img-src " PLATFORM_APP_LOCAL_CSP_SOURCES ";"
- " frame-src " PLATFORM_APP_LOCAL_CSP_SOURCES ";"
- " font-src " PLATFORM_APP_LOCAL_CSP_SOURCES ";"
+ " style-src " PLATFORM_APP_LOCAL_CSP_SOURCES
+ " 'unsafe-inline';"
+ " img-src " PLATFORM_APP_LOCAL_CSP_SOURCES
+ ";"
+ " frame-src " PLATFORM_APP_LOCAL_CSP_SOURCES
+ ";"
+ " font-src " PLATFORM_APP_LOCAL_CSP_SOURCES
+ ";"
Mike West 2015/06/16 13:04:47 This is all `git cl format`. Sorry. :/
Finnur 2015/06/16 13:20:01 Hmm... Looks less readable and therefore more erro
// Media can be loaded from remote resources since:
// 1. <video> and <audio> have good fallback behavior when offline or under
// spotty connectivity.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698