-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Disable node on child window when disabled on parent #4897
Conversation
| it('disables node integration when it is disabled on the parent window', function(done) { | ||
| var b; | ||
| listener = function(event) { | ||
| assert.equal(event.data, 'undefined'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to come up with an assertion that's less abstact. I know when we paired we tested the failure case before adding the implementation, but on its own this code gives me very little confidence that the feature actually works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I updated the assert to be for a isProcessGlobalUndefined value that is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
|
Are the builds flaky? |
Looks like the output was: So it looks like there may a case where a I'll investigate 🔍 |
595d8ab
to
027baad
Compare
|
/cc @wearhere @lukeapage wanted to get your thoughts on this new behavior since you both commented on #3943 and #4026 |
8e61430
to
230ed78
Compare
|
@zcbenz any concerns with merging this? 👀 |
|
👍 |
|
@kevinsawicki: I am using Electron 0.37.5 and webviews still can enable nodeintegration even if the parent has nodeintegration disabled. I was expecting this PR to prevent this, right? |
@laramies can you create a new issue with example code for this? Thanks |
|
@kevinsawicki I created #5171 but it was closed by @zcbenz as duplicate. Can you please confirm that it's going to be fixed, please? |
|
Does this PR address current security concerns about arbitrary script in remote pages accessing node resources? e.g. can I feel safe now that except for 0 day exploit that webview content cannot doing anything it couldn't do before if nodeintegration is not enabled? In my quick testing it appears so. |
If
nodeIntegrationis disabled on the parent window then disable it on all child windows opened viawindow.openor in<webview>tags.This prevents windows without node integration from opening new windows with node integration enabled.
This seems to be an intuitive behavior for this option, if you disable node on a window/webview then all downstream windows will also have node integration disabled preventing content run in those windows from "breaking out" and getting access to node integration via calls to
window.open.Fixes #3943
Fixes #4026
/cc @zeke 🍐