From 3f753c60daa3440a6d2dc956fc40353b1df7e743 Mon Sep 17 00:00:00 2001 From: dakrk Date: Sat, 6 May 2023 15:21:18 +0100 Subject: [PATCH] Trim usernames Previously it was possible to "impersonate" (to those not looking closely) other users by putting whitespace before or after the name of choice. This commit eliminates that. --- src/WSServer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WSServer.ts b/src/WSServer.ts index 188ed27..ca7fdb8 100644 --- a/src/WSServer.ts +++ b/src/WSServer.ts @@ -527,6 +527,7 @@ export default class WSServer { if (!newName) { client.assignGuestName(this.getUsernameList()); } else { + newName = newName.trim(); if (hadName && newName === oldname) { //@ts-ignore client.sendMsg(guacutils.encode("rename", "0", "0", client.username, client.rank));