Rev884, Improve security by stop accepting postMessage if opener present
This commit is contained in:
parent
c11d4f2632
commit
4cea7ebcda
3 changed files with 12 additions and 1 deletions
|
@ -8,7 +8,7 @@ class Config(object):
|
||||||
|
|
||||||
def __init__(self, argv):
|
def __init__(self, argv):
|
||||||
self.version = "0.3.6"
|
self.version = "0.3.6"
|
||||||
self.rev = 881
|
self.rev = 884
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
self.action = None
|
self.action = None
|
||||||
self.config_file = "zeronet.conf"
|
self.config_file = "zeronet.conf"
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
class Wrapper
|
class Wrapper
|
||||||
constructor: (ws_url) ->
|
constructor: (ws_url) ->
|
||||||
@log "Created!"
|
@log "Created!"
|
||||||
|
if window.opener
|
||||||
|
@log "Security error: Opener present, exiting..."
|
||||||
|
document.write("Forbidden: Opener present.")
|
||||||
|
document.body.innerHTML = "Forbidden: Opener present."
|
||||||
|
return
|
||||||
|
|
||||||
@loading = new Loading()
|
@loading = new Loading()
|
||||||
@notifications = new Notifications($(".notifications"))
|
@notifications = new Notifications($(".notifications"))
|
||||||
|
|
|
@ -762,6 +762,12 @@ jQuery.extend( jQuery.easing,
|
||||||
this.onMessageInner = __bind(this.onMessageInner, this);
|
this.onMessageInner = __bind(this.onMessageInner, this);
|
||||||
this.onMessageWebsocket = __bind(this.onMessageWebsocket, this);
|
this.onMessageWebsocket = __bind(this.onMessageWebsocket, this);
|
||||||
this.log("Created!");
|
this.log("Created!");
|
||||||
|
if (window.opener) {
|
||||||
|
this.log("Security error: Opener present, exiting...");
|
||||||
|
document.write("Forbidden: Opener present.");
|
||||||
|
document.body.innerHTML = "Forbidden: Opener present.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.loading = new Loading();
|
this.loading = new Loading();
|
||||||
this.notifications = new Notifications($(".notifications"));
|
this.notifications = new Notifications($(".notifications"));
|
||||||
this.fixbutton = new Fixbutton();
|
this.fixbutton = new Fixbutton();
|
||||||
|
|
Loading…
Reference in a new issue