Skip to content

Commit

Permalink
Fix electron window.open vulnerability (#3457)
Browse files Browse the repository at this point in the history
* Fix electron window.open vulnerability

* Comment to remove fix when merged into Hyper3
  • Loading branch information
chabou authored and juancampa committed Feb 5, 2019
1 parent 1a82866 commit 17fcae5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/ui/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ module.exports = class Window {
}
});

// mitigate a security issue: https://electronjs.org/blog/window-open-fix
// TODO: remove when merged into Hyper 3 (already has the fix via electron)
window.webContents.on('-add-new-contents', e => e.preventDefault());

// expose internals to extension authors
window.rpc = rpc;
window.sessions = sessions;
Expand Down

0 comments on commit 17fcae5

Please sign in to comment.