-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
[Feature Request]: Enable sandbox: true
by default for BrowserWindow
#28466
Comments
BrowserWindow
sandbox: true
by default for BrowserWindow
I think we could do this in a fairly gentle and non-breaking way by having the default of |
From what I read, If we are going to break people anyways by removing |
iirc plans for removing If we do end up deciding to take the plunge and remove |
@nornagon Removing |
Hm, wouldn't it still break // preload.js
window.my_node_thing = require('some_native_module_or_whatever')
// index.html
<script>my_node_thing.whatever()</script> Removing the ability to set |
this is kind of a dupe of this |
Ah yeah, I forgot I made that! I'm going to close that one out as a dupe of this one, as I think a lot of the comments on that one are now outdated. @anaisbetts's comment at #15760 (comment) is interesting, I think we've effectively already done the nuking that she was concerned about there with the switch to Leaving aside the discussion about removing the
The only issue that I can think of is on Linux distributions which don't enable unprivileged CLONE_NEWUSER (see #17972), apps which previously worked fine will start failing to boot unless they correctly configure the |
Can we please retain a way to disable sandboxing externally, via an environment variable? The reason for that is that electron sandbox conflicts with external sandboxing. External sandoxing (via bubblewrap, firejail etc) can be aware of local user's preferences. For example, it might only give access to a white list of directories and forbid the rest. |
@nornagon the problem is that not all apps respond to --no-sandbox if they have their own wrapper. An environment variable, on the other hand, is passed on to subprocesses, which is ideal (and only real working solution) for external sandboxes/jails. |
@vn971 please open a separate issue, let's keep this issue on the topic of enabling the |
Thinking more about this, I don't think this is actually a breaking change in this regard either, as on Linux systems even without any BrowserWindows being created with |
The plan now is to roll this out in a phased way, based on the value of
This gets us to a point where |
Preflight Checklist
Problem Description
Since Electron v5 the default behavior of
BrowserWindow
is to create it withnodeIntegration: false
. In v12contextIsolation
was turned on as well (see #23506). Another default that Electron should have issandbox: true
.Proposed Solution
I'd like the defaults of creating a new
BrowserWindow
to be equivalent to the following:Alternatives Considered
No alternatives considered. As @MarshallOfSound said in #23506:
Additional Information
Happy to dig and try to find any data needed to make a decission.
The text was updated successfully, but these errors were encountered: