From 9e69216c527f921107aab1c5d783e361a156d2a2 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 20 Jul 2018 01:09:55 +0300 Subject: [PATCH] Server validates the cursor positions clients send for a console command before using them! --- Barotrauma/BarotraumaShared/Source/DebugConsole.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs index 078ef2755..1ad87c716 100644 --- a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs @@ -1983,6 +1983,13 @@ namespace Barotrauma { GameMain.Server.SendConsoleMessage("Command \"" + splitCommand[0] + "\" not found.", client); return; + } + + if (!MathUtils.IsValid(cursorWorldPos)) + { + GameMain.Server.SendConsoleMessage("Could not execute command \"" + command + "\" - invalid cursor position.", client); + NewMessage(client.Name + " attempted to execute the console command \"" + command + "\" with invalid cursor position.", Color.White); + return; } try