Fix a vulnerability in chatMsg handler
This commit is contained in:
parent
babeb01ebe
commit
51d89b99e8
2 changed files with 10 additions and 0 deletions
|
|
@ -229,6 +229,13 @@ User.prototype.initCallbacks = function () {
|
|||
|
||||
self.socket.on("chatMsg", function (data) {
|
||||
if (self.inChannel()) {
|
||||
if (typeof data.msg !== "string") {
|
||||
self.socket.emit("kick", {
|
||||
reason: "Invalid chatMsg packet!"
|
||||
});
|
||||
self.socket.disconnect(true);
|
||||
return;
|
||||
}
|
||||
if (data.msg.indexOf("/afk") !== 0) {
|
||||
self.setAFK(false);
|
||||
self.autoAFK();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue