electron / electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
https://electronjs.org
MIT License
114.19k stars 15.4k forks source link

Proposal: Electron - Full Sandbox #10672

Closed nkolba closed 2 years ago

nkolba commented 7 years ago

This is a placeholder for a proposal coming out of the mini-summit in Tokyo 9/17 and specifically from conversations with Chromium and Edge teams around security.

The Chromium (and others) security and sandbox models are based on a design that only allows content access to a low privileged render process that is forced to proxy through a high privileged browser process for most functionality. This means when developing a web app, the developer does not have direct access to File System, Network, etc. In Electron, this model is replaced with one where an App developer has full access to both renderer and browser processes (bowser and main in Electron terminology).

Initial Thoughts

To run with sandbox in Electron today, an application must build its own security model and extend its own API into the sandboxed process. This model is limited because:

The goal of restructuring the the security and sandboxing scheme in Electron should be to:

At a high level, the end state we are targeting would look like this:

Additional Impacts/Benefits of this Approach

welcome[bot] commented 7 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

filipsebesta commented 6 years ago

Has this discussion progressed in any sense?

nkolba commented 6 years ago

Discussion hasn't progressed. We are working towards some of these things on our side. Would be great to discuss with the wider community.

nornagon commented 2 years ago

We've worked towards this now with things like contextBridge, removing remote, and sandboxing by default. I don't think the idea of a "sandboxed version of node" with policy enforced by the main process is likely to be possible to implement in a safe way—rather, the app is better off exposing application-specific IPC handlers through ipcRenderer.invoke / ipcMain.handle and contextBridge. Higher-level policies on methods like these are easier to enforce correctly.

As such, I'm closing this issue.