Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update csp #2826

Merged
merged 1 commit into from Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/clipper/src/manifest.v2.json
Expand Up @@ -16,7 +16,7 @@
"js": ["content.js"]
}
],
"content_security_policy": "default-src 'self'; script-src 'self' 'wasm-eval' 'wasm-unsafe-eval'; worker-src blob:; connect-src * data: blob:; style-src 'unsafe-inline' 'self'; frame-src * blob:; img-src * data: blob:;",
"content_security_policy": "default-src 'self'; script-src 'self' 'wasm-eval' 'wasm-unsafe-eval'; worker-src blob:; connect-src * data: blob:; style-src 'self'; frame-src * blob:; img-src * data: blob:;",
"icons": {
"16": "images/icon16.png",
"32": "images/icon32.png",
Expand Down
2 changes: 1 addition & 1 deletion packages/clipper/src/manifest.v3.json
Expand Up @@ -23,7 +23,7 @@
"128": "images/icon128.png"
},
"content_security_policy": {
"extension_pages": "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; connect-src * data: blob:; style-src 'unsafe-inline' 'self'; frame-src * blob:; img-src * data: blob:;"
"extension_pages": "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; connect-src * data: blob:; style-src 'self'; frame-src * blob:; img-src * data: blob:;"
},
"browser_specific_settings": {
"gecko": {
Expand Down
8 changes: 2 additions & 6 deletions packages/desktop/app/index.html
Expand Up @@ -2,18 +2,14 @@
<html>
<head>
<meta charset="utf-8" />
<!--
We need to set 'unsafe-eval' to use wasm.
https://bugs.chromium.org/p/chromium/issues/detail?id=948834
-->
<meta
http-equiv="Content-Security-Policy"
content="
default-src 'self' blob:;
script-src 'self' 'unsafe-eval';
script-src 'self' 'wasm-unsafe-eval';
worker-src 'self' blob:;
connect-src * data: blob:;
style-src 'unsafe-inline' 'self' http://localhost:* http://127.0.0.1:45653;
style-src 'self' http://localhost:* http://127.0.0.1:45653;
frame-src * blob:;
img-src * data: blob:;
"
Expand Down
57 changes: 0 additions & 57 deletions packages/web/index.html

This file was deleted.

1 change: 1 addition & 0 deletions packages/web/src/index.html
Expand Up @@ -30,6 +30,7 @@
<meta name="og:title" content="Standard Notes, an end-to-end encrypted notes app."/>
<meta name="og:description" content="Standard Notes is an easy-to-use encrypted note-taking app for digitalists and professionals. Capture your notes, documents, and life's work all in one place."/>

<!-- CSP script-src hash: sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs= -->
<script>
window.defaultSyncServer = "https://api.standardnotes.com";
window.defaultFilesHost = "https://files.standardnotes.com";
Expand Down
2 changes: 2 additions & 0 deletions packages/web/web.webpack.dev.js
Expand Up @@ -19,6 +19,8 @@ module.exports = (env, argv) => {
devServer: {
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Security-Policy':
"default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src * data: blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'wasm-unsafe-eval'; style-src *;",
},
hot: true,
static: './dist',
Expand Down