This commit is contained in:
Ylian Saint-Hilaire 2021-06-04 16:03:34 -07:00
parent 7d4c03fdc1
commit 75bb1f3e52
2 changed files with 12 additions and 10 deletions

View File

@ -155,12 +155,13 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if (parent.parent.multiServer != null) { parent.parent.multiServer.DispatchMessage({ action: 'sessionEnd', sessionid: ws.sessionId }); }
// Aggressive cleanup
if (obj.user) { delete obj.user; }
if (obj.domain) { delete obj.domain; }
if (ws.userid) { delete ws.userid; }
if (ws.domainid) { delete ws.domainid; }
if (ws.sessionId) { delete ws.sessionId; }
if (ws.HandleEvent) { delete ws.HandleEvent; }
delete obj.user;
delete obj.domain;
delete ws.userid;
delete ws.domainid;
delete ws.clientIp;
delete ws.sessionId;
delete ws.HandleEvent;
ws.removeAllListeners(['message', 'close', 'error']);
};
@ -329,6 +330,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Associate this websocket session with the web session
ws.userid = user._id;
ws.domainid = domain.id;
ws.clientIp = req.clientIp;
// Create a new session id for this user.
parent.crypto.randomBytes(20, function (err, randombuf) {
@ -1299,9 +1301,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
userSessionCount++;
r += (i + ', ' + parent.wssessions[i].length + ' session' + ((parent.wssessions[i].length > 1) ? 's' : '') + '.\r\n');
for (var j in parent.wssessions[i]) {
var addr = parent.wssessions[i][j]._socket.remoteAddress;
if (addr.startsWith('::ffff:')) { addr = addr.substring(7); }
r += ' ' + addr + ' --> ' + parent.wssessions[i][j].sessionId + '\r\n';
r += ' ' + parent.wssessions[i][j].clientIp + ' --> ' + parent.wssessions[i][j].sessionId + '\r\n';
}
}
}

View File

@ -12388,7 +12388,9 @@
114: "Removed push notification authentication device",
115: "Added login token",
116: "Removed login token",
117: "This is an old agent version, consider updating."
117: "This is an old agent version, consider updating.",
118: "This agent has an outstated certificate validation mechanism, consider updating.",
119: "This agent is using insecure tunnels, consider updating."
};
// Highlights the device being hovered