Skip to content

SendTileRect logic flaw leading to world destruction and DoS

Critical
hakusaro published GHSA-q776-cv3j-4q6m May 22, 2021

Package

TShock for Terraria

Affected versions

>= 4.4.0-pre15

Patched versions

>= 4.5.3

Description

Impact

Terraria multiplayer, by default, is not secure in many ways. An attacker can, by default, delete the entire world. TShock attempts to protect against these types of bypasses. However, a vulnerability was recently discovered that allows a user to wipe a TShock protected map arbitrarily, even when the user is disabled. This exploit relies on the fact that TShock's SendTileRect handler was changed to be more tolerant of game logic. While we successfully made the handler more game logic tolerating, a hole was created. This enables an attacker to supply extra tile data, in addition to legitimate conversion data. The extra data is not sanitized and is applied as-is, which means that any bad values in the extra data fields not used for legitimate conversions can be used to destroy tiles.

Patches & versions

TShock 4.5.3 patches the exploit. All subsequent versions include the fix. We believe the underlying vulnerable code to have been introduced in TShock 4.4.0-pre15, but we did not exhaustively test or probe earlier versions of TShock to see if a similar vulnerability exists. It is likely "safe" to run an earlier version of TShock than 4.4.0-pre15, but if you rely on TShock for protection you should strongly consider validating the code yourself. This is particularly true if you maintain a private fork and infrequently update against upstream.

Workarounds

Turn on world backups in config.json, use a whitelist, or password protect your server, if you cannot update.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

CVE ID

No known CVE

Credits