GHSA-f8mx-cwfh-7hr2

Suggest an improvement
Source
https://github.com/advisories/GHSA-f8mx-cwfh-7hr2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/02/GHSA-f8mx-cwfh-7hr2/GHSA-f8mx-cwfh-7hr2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-f8mx-cwfh-7hr2
Published
2025-02-03T16:02:36Z
Modified
2025-02-03T16:24:14Z
Severity
  • 6.9 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N CVSS Calculator
Summary
TShock allows chat while not fully connected, possible ban evasion
Details

This issue was reported to TShock by @ohayo, but was found by the Discord user by the name of sofurry.com. Please note that this user does not own this domain on the internet, just the discord handle.

TShock overrides certain Terraria vanilla systems, including chat, and the connection handling, for its own purposes, like enforcing bans. When clients connect but do not complete the connection handshake (e.g., send message number 6), they can "exist" on the server, occupy a player slot, chat, and receive data from the server despite not being fully connected. Individuals who exploit this will be able to effectively harass the server, observe the server, and utilize server resources even if banned from the server.

For servers that operate with a proxy that strictly enforces the connection handshake/sequence, this is not an issue, but for smaller servers or servers running vanilla TShock this is an issue worth patching for.

PR body supplied by @ohayo (patch writer):

Terraria's standard server by default checks for bans upon the client sending the ConnectRequest packet, however, TShock instead chooses to check if the client connecting is banned upon the Request World Data packet.

A malicious client can easily just not send this packet, and still join the server even while being banned. Also by not sending Request World Data, the malicious client is still able to receive all packets from the server & even chat.

Other clients will not be notified of their join/leave but will be able to see them on the player list. Leading to potential chat spam & "spying" on packets of players within the server.

Database specific
{
    "cwe_ids":  [
        "CWE-285"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2025-02-03T16:02:36Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

NuGet / TShock

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
5.2.2

Affected versions

5.*
5.0.0-beta
5.0.0
5.1.0
5.1.1
5.1.2
5.1.3
5.2.0
5.2.1

Database specific

last_known_affected_version_range
"<= 5.2.1"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/02/GHSA-f8mx-cwfh-7hr2/GHSA-f8mx-cwfh-7hr2.json"