From 536346da119a382657ffbe5cfdfeb8af5b6a4aa0 Mon Sep 17 00:00:00 2001 From: Regalis11 Date: Tue, 16 Apr 2024 18:00:23 +0300 Subject: [PATCH 1/2] v1.3.0.4 --- .../Networking/Primitives/Peers/P2POwnerPeer.cs | 13 +++++++++++-- Barotrauma/BarotraumaClient/LinuxClient.csproj | 2 +- Barotrauma/BarotraumaClient/MacClient.csproj | 2 +- Barotrauma/BarotraumaClient/WindowsClient.csproj | 2 +- Barotrauma/BarotraumaServer/LinuxServer.csproj | 2 +- Barotrauma/BarotraumaServer/MacServer.csproj | 2 +- Barotrauma/BarotraumaServer/WindowsServer.csproj | 2 +- .../BarotraumaShared/SharedSource/DebugConsole.cs | 2 +- Barotrauma/BarotraumaShared/changelog.txt | 6 ++++++ 9 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Barotrauma/BarotraumaClient/ClientSource/Networking/Primitives/Peers/P2POwnerPeer.cs b/Barotrauma/BarotraumaClient/ClientSource/Networking/Primitives/Peers/P2POwnerPeer.cs index 537345b0c8..f9b0d00819 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/Networking/Primitives/Peers/P2POwnerPeer.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/Networking/Primitives/Peers/P2POwnerPeer.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable using Barotrauma.Extensions; using Barotrauma.Steam; using System; @@ -152,7 +152,16 @@ private void OnP2PData(P2PEndpoint senderEndpoint, IReadMessage inc) if (packetHeader.IsConnectionInitializationStep()) { - ConnectionInitialization initialization = peerPacketHeaders.Initialization ?? throw new Exception("Initialization step missing"); + if (peerPacketHeaders.Initialization == null) + { + //can happen if the packet is crafted in a way to leave the Initialization value as null + DebugConsole.ThrowErrorOnce( + $"P2POwnerPeer.OnP2PData:{remotePeer.Endpoint.StringRepresentation}", + $"Failed to initialize remote peer {remotePeer.Endpoint.StringRepresentation}: initialization step missing."); + CommunicateDisconnectToRemotePeer(remotePeer, PeerDisconnectPacket.WithReason(DisconnectReason.MalformedData)); + return; + } + ConnectionInitialization initialization = peerPacketHeaders.Initialization.Value; if (initialization == ConnectionInitialization.AuthInfoAndVersion && remotePeer.AuthStatus == RemotePeer.AuthenticationStatus.NotAuthenticated) { diff --git a/Barotrauma/BarotraumaClient/LinuxClient.csproj b/Barotrauma/BarotraumaClient/LinuxClient.csproj index d49b2ab216..f685198c3c 100644 --- a/Barotrauma/BarotraumaClient/LinuxClient.csproj +++ b/Barotrauma/BarotraumaClient/LinuxClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.3.0.3 + 1.3.0.4 Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/MacClient.csproj b/Barotrauma/BarotraumaClient/MacClient.csproj index 3d31486985..c71af10d65 100644 --- a/Barotrauma/BarotraumaClient/MacClient.csproj +++ b/Barotrauma/BarotraumaClient/MacClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.3.0.3 + 1.3.0.4 Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaClient/WindowsClient.csproj b/Barotrauma/BarotraumaClient/WindowsClient.csproj index f5f537757e..0608b7d9d0 100644 --- a/Barotrauma/BarotraumaClient/WindowsClient.csproj +++ b/Barotrauma/BarotraumaClient/WindowsClient.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma - 1.3.0.3 + 1.3.0.4 Copyright © FakeFish 2018-2023 AnyCPU;x64 Barotrauma diff --git a/Barotrauma/BarotraumaServer/LinuxServer.csproj b/Barotrauma/BarotraumaServer/LinuxServer.csproj index 5ce39bac1c..a39539d079 100644 --- a/Barotrauma/BarotraumaServer/LinuxServer.csproj +++ b/Barotrauma/BarotraumaServer/LinuxServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.3.0.3 + 1.3.0.4 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/MacServer.csproj b/Barotrauma/BarotraumaServer/MacServer.csproj index 6fd38119a9..dd5b226194 100644 --- a/Barotrauma/BarotraumaServer/MacServer.csproj +++ b/Barotrauma/BarotraumaServer/MacServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.3.0.3 + 1.3.0.4 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaServer/WindowsServer.csproj b/Barotrauma/BarotraumaServer/WindowsServer.csproj index 2fe048e3d8..b02ff43fb3 100644 --- a/Barotrauma/BarotraumaServer/WindowsServer.csproj +++ b/Barotrauma/BarotraumaServer/WindowsServer.csproj @@ -6,7 +6,7 @@ Barotrauma FakeFish, Undertow Games Barotrauma Dedicated Server - 1.3.0.3 + 1.3.0.4 Copyright © FakeFish 2018-2023 AnyCPU;x64 DedicatedServer diff --git a/Barotrauma/BarotraumaShared/SharedSource/DebugConsole.cs b/Barotrauma/BarotraumaShared/SharedSource/DebugConsole.cs index dd6b412814..c30424c237 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/DebugConsole.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/DebugConsole.cs @@ -2615,7 +2615,7 @@ public static void ThrowErrorAndLogToGA(string gaIdentifier, string errorMsg) /// /// Log the error message, but only if an error with the same identifier hasn't been thrown yet during this session. /// - public static void ThrowErrorOnce(string identifier, string errorMsg, Exception e) + public static void ThrowErrorOnce(string identifier, string errorMsg, Exception e = null) { if (loggedErrorIdentifiers.Contains(identifier)) { return; } ThrowError(errorMsg, e); diff --git a/Barotrauma/BarotraumaShared/changelog.txt b/Barotrauma/BarotraumaShared/changelog.txt index 9b3a8ee2f0..3178f482cd 100644 --- a/Barotrauma/BarotraumaShared/changelog.txt +++ b/Barotrauma/BarotraumaShared/changelog.txt @@ -1,3 +1,9 @@ +------------------------------------------------------------------------------------------------------------------------------------------------- +v1.3.0.4 +------------------------------------------------------------------------------------------------------------------------------------------------- + +- Fixed another exploit that allowed crashing servers by sending them specifically crafted malformed data. + ------------------------------------------------------------------------------------------------------------------------------------------------- v1.3.0.3 ------------------------------------------------------------------------------------------------------------------------------------------------- From 8face2f344a1f53e6637451a7750221b17c5e7cf Mon Sep 17 00:00:00 2001 From: Regalis11 Date: Tue, 16 Apr 2024 18:01:42 +0300 Subject: [PATCH 2/2] Updated issue template --- .github/DISCUSSION_TEMPLATE/bug-reports.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/DISCUSSION_TEMPLATE/bug-reports.yml b/.github/DISCUSSION_TEMPLATE/bug-reports.yml index 7f8dfb6e5e..3a3c429d1a 100644 --- a/.github/DISCUSSION_TEMPLATE/bug-reports.yml +++ b/.github/DISCUSSION_TEMPLATE/bug-reports.yml @@ -73,8 +73,8 @@ body: label: Version description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu. options: - - v1.3.0.3 - - v1.4.0.0 (unstable) + - v1.3.0.4 + - v1.4.3.0 (unstable) - Other validations: required: true