A code vulnerability has been discovered that allows Node to be re-enabled in child windows.
Opening a BrowserView with
sandbox: true or
nativeWindowOpen: true and
nodeIntegration: false results in a webContents where
window.open can be called and the newly opened child window will have
nodeIntegration enabled. This vulnerability affects all supported versions of Electron.
We've published new versions of Electron which include fixes for this vulnerability:
We encourage all Electron developers to update their apps to the latest stable version immediately.
If for some reason you are unable to upgrade your Electron version, you can mitigate this issue by disabling all child web contents:
view.webContents.on('-add-new-contents', (e) => e.preventDefault());
This vulnerability was found and reported responsibly to the Electron project by PalmerAL.
To learn more about best practices for keeping your Electron apps secure, see our security tutorial.
If you wish to report a vulnerability in Electron, email email@example.com.