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 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 5bfa863a17..bc6057d8ba 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 6891d13113..6fbbca0c55 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 7ba7dd5f65..c0ab50d093 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 89c192043b..65273750fd 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 efed825f59..f162a12e02 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 6f843afd8f..ce53425309 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 98628512cb..062bd0a4c7 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/DebugConsole.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/DebugConsole.cs @@ -2616,7 +2616,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 -------------------------------------------------------------------------------------------------------------------------------------------------