Replaced eval with new Function when executing data coming from BeEF's WebSocket server.

This commit is contained in:
antisnatchor
2013-03-05 10:37:49 +00:00
parent 6a968e77c0
commit 713a20f157

View File

@@ -53,9 +53,10 @@ beef.websocket = {
};
this.socket.onmessage = function (message) {
//todo: double-check if there is a way to don't use eval here. It's not a big deal,
//todo: because the eval'ed data comes from BeEF itself, so is implicitly trusted.
eval(message.data);
// Data coming from the WebSocket channel is either of String, Blob or ArrayBufferdata type.
// That's why it needs to be evaluated first. Using Function is a bit better than pure eval().
// It's not a big deal anyway, because the eval'ed data comes from BeEF itself, so it is implicitly trusted.
new Function(message.data)();
};
this.socket.onclose = function () {