GHSA-hvm9-wc8j-mgrc: TShock TShock Security Escalation Exploit Vulnerability

HIGH
CWE-613 CWE-305 CWE-863
Published
Advisory Summary

GHSA-hvm9-wc8j-mgrc is a HIGH tshock security escalation exploit vulnerability (CWE-613: Insufficient Session Expiration) affecting TShock libraries in the NuGet ecosystem. The issue involves tshock security escalation exploit. Remediation is available by upgrading affected packages to version 5.2.1.

GHSA-hvm9-wc8j-mgrc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-hvm9-wc8j-mgrc
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product TShock
Package Ecosystem NuGet
Published Date
Last Updated

How to Fix GHSA-hvm9-wc8j-mgrc

To remediate this vulnerability, upgrade all affected TShock dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

TShock fixed: 5.2.1
Upgrade TShock to 5.2.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for TShock

How to Check if You Are Affected

To determine whether your application is affected by GHSA-hvm9-wc8j-mgrc, inspect your project dependencies for TShock:

inspect dependencies for TShock

Analyze the terminal output to locate any version of TShock in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In TShock, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact An issue with the way OTAPI manages client connections results in stale UUIDs remaining on `RemoteClient` instances after a player disconnects. Because of this, if the following conditions are met a player may assume the login state of a previously connected player: 1. The server has UUID login enabled 2. An authenticated player disconnects 3. A subsequent player connects with a modified client that does not send the `ClientUUID#68` packet during connection 4. The server assigns the same `RemoteClient` object that belonged to the originally authenticated player to the newly connected player ### Patches TShock 5.2.1 hotfixes this issue. A more robust fix will be made to OTAPI itself. ### Workarounds Implement a RemoteClient reset event handler in a plugin like so: ```csharp 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); } ```

GHSA-hvm9-wc8j-mgrc Affected TShock Versions

1 component(s)
Fixed Versions:
5.2.1
Product / Package Ecosystem Affected Versions Fixed Version
TShock
NuGet
≥ 4.3.21
< 5.2.1
5.2.1

References

Frequently Asked Questions

What is GHSA-hvm9-wc8j-mgrc?
GHSA-hvm9-wc8j-mgrc is a security vulnerability in TShock involving TShock Security Escalation Exploit under CWE-613: Insufficient Session Expiration.
Which TShock versions are affected?
Affected versions include releases prior to 5.2.1 across affected packages: TShock.
What version fixes GHSA-hvm9-wc8j-mgrc?
Upgrading to 5.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is TShock affected?
Yes, TShock is affected in releases prior to 5.2.1. Upgrade your dependency to 5.2.1 or later.
What CWE is associated with GHSA-hvm9-wc8j-mgrc?
GHSA-hvm9-wc8j-mgrc is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check NuGet dependencies for GHSA-hvm9-wc8j-mgrc?
Run the dependency tree command: 'inspect dependencies for TShock'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hvm9-wc8j-mgrc",
  "modified" : "2024-12-18T18:19:12Z",
  "published" : "2024-12-18T18:19:12Z",
  "aliases" : [ ],
  "summary" : "TShock Security Escalation Exploit",
  "details" : "### Impact\nAn issue with the way OTAPI manages client connections results in stale UUIDs remaining on `RemoteClient` instances after a player disconnects.\n\nBecause of this, if the following conditions are met a player may assume the login state of a previously connected player:\n1. The server has UUID login enabled\n2. An authenticated player disconnects\n3. A subsequent player connects with a modified client that does not send the `ClientUUID#68` packet during connection\n4. The server assigns the same `RemoteClient` object that belonged to the originally authenticated player to the newly connected player\n\n\n### Patches\nTShock 5.2.1 hotfixes this issue. A more robust fix will be made to OTAPI itself.\n\n### Workarounds\nImplement a RemoteClient reset event handler in a plugin like so:\n```csharp\npublic override void Initialize()\n{\n        On.Terraria.RemoteClient.Reset += RemoteClient_Reset;\n}\n\nprivate static void RemoteClient_Reset(On.Terraria.RemoteClient.orig_Reset orig, RemoteClient client)\n{\n\tclient.ClientUUID = null;\n        orig(client);\n}\n```\n\n",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:L/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "TShock"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.3.21"
      }, {
        "fixed" : "5.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Pryaxis/TShock/security/advisories/GHSA-hvm9-wc8j-mgrc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Pryaxis/TShock/commit/5075997264b48e27960e3446a948ecb0ea0f5a03"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Pryaxis/TShock"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-305", "CWE-613", "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-18T18:19:12Z",
    "nvd_published_at" : null
  }
}