Authentication Bypass by Primary Weakness Affecting tshock package, versions [,5.2.1)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-DOTNET-TSHOCK-8536765
  • published19 Dec 2024
  • disclosed18 Dec 2024
  • creditStargazing Koishi, THEXN

Introduced: 18 Dec 2024

CVE NOT AVAILABLE CWE-305  (opens in a new tab)

How to fix?

Upgrade TShock to version 5.2.1 or higher.

Overview

Affected versions of this package are vulnerable to Authentication Bypass by Primary Weakness due to the management of client connections by OTAPI, which allows stale UUIDs to remain on RemoteClient instances after a player disconnects. An attacker can assume the login state of a previously connected player by connecting with a modified client that omits the ClientUUID#68 packet.

Note: This is only exploitable if the server has UUID login enabled, an authenticated player disconnects, and the server assigns the same RemoteClient object to the newly connected player.

Workaround

This vulnerability can be mitigated by implementing a RemoteClient reset event handler in a plugin.

public override void Initialize()
{
        On.Terraria.RemoteClient.Reset += RemoteClient_Reset;
}

private static void RemoteClient_Reset(On.Terraria.RemoteClient.orig_Reset orig, RemoteClient client) { client.ClientUUID = null; orig(client); }

References

CVSS Scores

version 4.0
version 3.1