You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to evaluate modifying our content security policy in renderer's index.ejs and in webview's web-view.service.ts to meet the needs of extension developers in a secure way:
Evaluate data: uris for supplying images and such. Are these secure?
Note: the little resize triangle on floating windows use rc-dock's built-in class .dock-panel-drag-size-b-r, which has a data url on background-image.
Google's CSP evaluator allows this. I can't find much that says anything bad about it regarding specifically images and such. Bad on script-src though
Since wasm code does not allow anything more than the code can do already, let's allow it. However, we should only allow it in the child iframes since this may be a possible avenue for webviews to inject code into the parent. Needs investigation
Looks like emscripten, a C++ wasm compiler, may use XmlHttpRequest behind the scenes
We can't restrict CSP on extension host right now. We could do one of a few things:
Say no XmlHttpRequest on extension host. Deal with it. There already isn't XmlHttpRequest in node, so this is default and current behavior
Change extension host process into a hidden Electron BrowserWindow so we can enforce our CSP
Implement our own XHR
Maybe we can just tell people to include wasm in their extension and allow papi-extension:? That would mean any extension can load any script. Is this ok?
Note that Google's CSP checker does not warn or error on this
Determine if we should sync the CSP between index.ejs and web-view.service.ts
No. There are a few things that must be more restrictive in webview iframes. However, most of it should be the same.
Determine if we should add other elements to the list of disallowed elements other than script like a and link
Yes. There are a number of quite insecure tags
Should we allow webviews to be iframes to other urls?
Looks like it's not a big security concern if it's on a different origin. Removing allow-same-origin prevents us from getting in trouble with blob:s which do execute on same origin
As a user of an extension, I would like to connect to the internet so that I can get content.
Crowd.Bible's people tried to make a paranext extension, and it required security access beyond our current CSP's abilities. They modified the CSP's to fit their needs as described here: https://github.com/etenlab/docs/blob/dev/docs/DevTeam/paranext-extension.md#known-problems-and-ways-to-tackle-them
We need to evaluate modifying our content security policy in renderer's
index.ejs
and in webview'sweb-view.service.ts
to meet the needs of extension developers in a secure way:data:
uris for supplying images and such. Are these secure?rc-dock
's built-in class.dock-panel-drag-size-b-r
, which has a data url onbackground-image
.https:
to media sources and/orconnect-src
script-src
a way to run wasm likewasm-unsafe-eval
orpapi-extension:
- some thoughts https://github.com/WebAssembly/content-security-policy/blob/main/proposals/CSP.mdpapi-extension:
? That would mean any extension can load any script. Is this ok?delete XmlHttpRequest
on webviewswindow.top
is readonly - prevents us from isolating webviews #176 option 1 basically means that will not be possible, but at least anything would still have to go through our CSPindex.ejs
andweb-view.service.ts
script
likea
andlink
allow-same-origin
prevents us from getting in trouble withblob:
s which do execute on same originClosely related to #89
Depends on the design decision from #176
The text was updated successfully, but these errors were encountered: