Skip to content

Login session ids are sequential, and they are all that guards a world entry #3110

Closed
NosCoreIO/NosCore.Networking
#214

Description

@erwan-joly

What happens

After a login, the master server keeps a world entry grant keyed by the account name and the login session id. The world server redeems it with the name and the session id the connecting client announces (EntryPointPacketHandler → RedeemWorldEntryAsync). Nothing else ties the world connection to the player who logged in.

The session id is not a secret: SessionRefHolder.GenerateSessionId in NosCore.Networking is a counter that goes up by two per login connection, starting from 2 at every restart. The logs of a fresh server show it:

INFO -- New client connected. ClientId = 2
INFO -- New client connected. ClientId = 4

A wrong session id leaves the grant in place (deliberately, so that nobody can burn another player's grant), so whoever knows an account name can open world connections with the last few even numbers while that player is on the channel list, and enter the world as them.

Expected

The session id a login hands out cannot be guessed: drawn from a cryptographic random source over the widest range the client accepts, and unique among the sessions alive at that moment.

Notes

  • The range needs checking in the client before it is widened: the id also keys the world packet encoding, and the client has to accept it in NsTeST.
  • The lifetime of the grant does not protect against this; a handful of guesses is enough. It matters for A player who takes over a minute to pick a channel is refused by the world server #3109, which lengthens that lifetime.
  • The generator lives in NosCore.Networking, so the fix is a release of that package and a version bump here.

Generated by Claude Code

Activity

  1. erwan-joly commented on Nov 14, 2026

    @erwan-joly
    CollaboratorAuthor

    Taking this one.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions