Skip to content

feat: enable sandbox by default in limited circumstances - #30197

Merged
nornagon merged 8 commits into
mainfrom
sandbox-by-default-2
Aug 3, 2021
Merged

nornagon merged 8 commits into
mainfrom
sandbox-by-default-2

Conversation

@nornagon

Copy link
Copy Markdown
Contributor

Description of Change

Depends on #30193.

Closes #28466.

This enables sandbox: true by default unless nodeIntegration is true,
nodeIntegrationInWorker is true, or preload is specified. This is a
non-breaking change, because unless one of these options is true, there's no
documented way to perform any action that would cause different behavior
depending on whether the sandbox is enabled or not.

Checklist

Release Notes

Notes: Enabled sandboxing by default on WebContents which do not use Node or preloads.

@nornagon nornagon added no-backport semver/patch backwards-compatible bug fixes labels Jul 19, 2021
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jul 19, 2021
@nornagon
nornagon force-pushed the sandbox-by-default-2 branch from edbc470 to 637011f Compare July 19, 2021 20:17
@nornagon
nornagon force-pushed the sandbox-by-default-2 branch from 637011f to d46e202 Compare July 19, 2021 20:17
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Jul 20, 2021
Base automatically changed from webpreferences-refactor to main July 26, 2021 16:04
@nornagon nornagon changed the title feat: enable sandbox by default feat: enable sandbox by default in limited circumstances Jul 26, 2021
@nornagon
nornagon requested a review from MarshallOfSound July 26, 2021 23:42

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also have to care about SessionPreferences::GetValidPreloads(web_contents->GetBrowserContext()). There are multiple way to assign preload scripts 🤔

@nornagon
nornagon requested a review from MarshallOfSound July 30, 2021 21:41
Comment thread spec-main/guest-window-manager-spec.ts Resolved
@nornagon

nornagon commented Aug 3, 2021

Copy link
Copy Markdown
Contributor Author

@MarshallOfSound PTAL

@nornagon
nornagon merged commit 8179349 into main Aug 3, 2021
@nornagon
nornagon deleted the sandbox-by-default-2 branch August 3, 2021 22:07
@release-clerk

release-clerk Bot commented Aug 3, 2021

Copy link
Copy Markdown

Release Notes Persisted

Enabled sandboxing by default on WebContents which do not use Node or preloads.

@trop

trop Bot commented Aug 3, 2021

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "15-x-y" cleanly;
you will need to perform this backport manually.

@nornagon

nornagon commented Aug 4, 2021

Copy link
Copy Markdown
Contributor Author

Ah, this depends on #30193, which isn't backported to 15. I think I'll leave this for 16.x then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Enable sandbox: true by default for BrowserWindow

2 participants