Disable UUID auto-login for superadmin group#3294
Conversation
| // Require manual /login for superadmin accounts (fixes #3278) | ||
| if (group.Name == "superadmin") | ||
| { | ||
| TShock.CharacterDB.SyncSeededAppearance(account, args.Player); | ||
| args.Player.PlayerData = TShock.CharacterDB.GetPlayerData(args.Player, account.ID); | ||
| // Skip UUID auto-login; player must authenticate manually | ||
| } |
There was a problem hiding this comment.
Double WorldInfo packet sent to superadmin clients
Before this check, line 2850 unconditionally sends WorldInfo to the player whenever the UUID matches. When group.Name == "superadmin" the empty if body falls through to line 2924, which sends WorldInfo a second time. The non-superadmin path avoids this via its return true at line 2904, but the superadmin path has no early exit. Sending the same packet twice unexpectedly may confuse the client's connection state machine.
| if (group.Name == "superadmin") | ||
| { | ||
| TShock.CharacterDB.SyncSeededAppearance(account, args.Player); | ||
| args.Player.PlayerData = TShock.CharacterDB.GetPlayerData(args.Player, account.ID); | ||
| // Skip UUID auto-login; player must authenticate manually | ||
| } |
There was a problem hiding this comment.
No feedback to superadmin player about required manual login
When a superadmin's UUID matches and auto-login is skipped, the player receives no message explaining that they must use /login. They connect as an unauthenticated user silently, with no indication of why their UUID did not log them in. The feature's stated goal is to require manual login, but without a notification (e.g., args.Player.SendInfoMessage(...)) the player has no way to know the auto-login was intentionally blocked.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
1a0c877 to
e55d19c
Compare
|
Fixed Greptile feedback: added early return and SendInfoMessage for superadmin UUID block. |
|
So as to not break current functionality, could it be possible to make this change appear behind a feature flag or option ? While I agree that UUID login presents risks, there should be a best effort made to preserve existing flows whilst allowing gradual/at-will security hardening. Thoughts @hakusaro ? |
Disables UUID-based auto-login for the superadmin group as a security measure. SuperAdmin accounts must now manually authenticate with /login, preventing stolen UUIDs from granting immediate full server access. Fixes Pryaxis#3278
e55d19c to
2aa645b
Compare
|
Updated to use a config option as requested. Added DisableSuperAdminUUIDLogin (default: true) in TShockConfig.cs. Server owners can opt out by setting it to false if they want to preserve the old UUID auto-login behavior for superadmin accounts. |
Fixes #3278. Prevents superadmin accounts from being automatically authenticated via UUID, requiring manual /login instead.