Security notes
What this page is for
Section titled “What this page is for”This page says what the host checks when a player joins and plays, what the keys and the password do, and where the protection stops. It describes what the code does. It makes no claim that the add-on was audited.
Know this first. The host’s machine runs the whole world and can read all of it. Nothing here stops a host who wants to cheat. Play with people you trust, or on a dedicated host nobody plays on. HostPlaysFair (on by default) only keeps an honest host from learning secrets by accident. See Who sees what.
What the host checks on a join
Section titled “What the host checks on a join”When a hello arrives, the host works through these checks. Each refusal shows the player a reason, and the table of reasons is on Multiplayer tools and troubleshooting.
| Check | What it does | Source |
|---|---|---|
| Versions and content | The versions of Intrigues and of the add-on, and the content hash, must match. The hash covers the database definitions, the scene’s characters and the asset table, not names and texts. | HostSession.cs lines 1111 and 1119; Handshake.cs lines 87 to 96 (the hash) |
| Banned address | Closed before anything the connection sends is read. | HostSession.cs lines 888 to 894 |
| Banned key | A hello with a banned seat key is refused. | HostSession.cs line 1263 |
| Identity | Your SeatPolicy.Identify, if you wrote one. A banned identity is refused under any address or key. |
HostSession.cs line 1270 |
| Password | Wrong tries are counted per address and slow down. | HostSession.cs line 1708, JoinGuard.cs |
| Your join rule | SeatPolicy.AllowJoin, MaxPlayers, Accepting, and which characters may be taken. |
HostSession.cs lines 1297 to 1345 |
After that, everything a player sends is checked too. A player cannot act for a character someone else plays. Each kind of message has a size limit and a rate, and a player who keeps breaking them is disconnected. The numbers are in the Settings reference.
The password
Section titled “The password”Set a long password on a host that is reachable from the internet. Wrong passwords are counted per address. PasswordFailuresPerAddress (5) wrong tries are allowed in a minute; one more blocks the address for 60 seconds, doubled for each block in a row up to 600 seconds. Past PasswordFailuresPerMinute (30) from all addresses together, every new try waits 10 seconds, and about one try per 2 seconds still goes through. A rejoin with a seat key is not held by the address block or the shared pause. Its own wrong passwords are counted for that key (three times the address count), and the key then waits. Identified players are counted apart. Players your SeatPolicy.Identify vouched for have their own block and ceiling (JoinGuard.cs lines 160 to 175).
Behind a relay, players cannot be told apart by address. A relay’s lobby is then the real gate: keep the join code among the players.
Encryption
Section titled “Encryption”The connection carries the password and the players’ keys as plain bytes unless you turn on encryption. The comment on the Netcode Session component says the hello travels unencrypted without DTLS or Relay. The README names UnityTransport > Use Encryption (DTLS) for a direct connection, and Unity Relay, which chooses its own. Encryption protects the connection. It does not prove who a player is.
This page did not run an encrypted connection.
The seat key
Section titled “The seat key”When a player joins, the host gives them a 128-bit key for their seat. A player who loses the connection comes back to the same seat by proving they hold the key. The key itself is not sent again. The comments in Handshake.cs describe a challenge and a response made with HMAC-SHA256, in which the host proves first that it issued the key. A different host that copies the address gets nothing it can use.
By default the keys stay in memory on the player’s machine, so a restarted game joins as a new player. Your game can keep them. Both are instance methods of SeatKeyStore; with the Netcode Session component you reach the store as its Keys.
| Call | What it does |
|---|---|
Export() |
Gives the keys as text. |
Import(text) |
Takes them back and returns an int. A damaged or oversized text imports nothing. |
Keep that text where only this user can read it. It opens those seats. Treat it like a password. A copied file lets its holder take the seat. The newest connection wins.
The store caps itself: 8 sessions per host (SessionsPerHost), 16 hosts (MaxHosts), 32 KB (MaxExportChars), and it forgets a key unused for 90 days (ExpiryDays). A kicked player is told once and forgets the key. The host saves the keys with its game, in plain text on its own disk, so protect the host’s disk. See Saving in multiplayer.
sources: SeatKeyStore.cs lines 47 to 70; README “Security notes”.
Identity and bans
Section titled “Identity and bans”MultiplayerSession.Kick(seat) removes a seat; the same player may join again as a new player. MultiplayerSession.Ban(seat, reason, byAddress) removes the seat, refuses its key, and, with byAddress, closes every connection from the address the player last used. Bans last for the run of the game, over later sessions, until MultiplayerSession.ClearBans(). They are not saved.
Two limits matter:
- NAT. An address ban shuts out everyone behind that address, such as a household. Pass
byAddressfalse to ban the key and the identity only. - Relay. Behind a relay there is no address. Without an identity, a ban is a kick that also refuses the key, and the player can come back as a new player with the join code and the password.
To make bans hold, give each player a proof of who they are. Set ClientSettings.IdentityToken to a one-time ticket that your own server issued for this one join. It names the host’s lobby or join code and expires within minutes. Check it in your own SeatPolicy.Identify. A ban then keeps that player out under any address, if your SeatPolicy.AllowJoin also refuses players who come without a token.
Never use a password or the access token of a login service as that token. The host could keep it and act as that player. The token travels in the hello as plain text, so use encryption. The client refuses a token longer than 512 characters.
A saved seat whose player cannot prove it
Section titled “A saved seat whose player cannot prove it”A loaded game can keep a seat for a player who lost their key. The character stays taken by that away seat. Only the host can give it to someone else. MultiplayerSession.HandAwaySeat(awaySeat, toSeat) gives it to a connected player who plays no character yet. Kick(awaySeat) frees it, and FreeAwaySeat(awaySeat) frees it only while the player is still away. A name that matches may help the host choose. It never decides, and nothing a player sends can ask for it.
What the add-on cannot do
Section titled “What the add-on cannot do”- It cannot stop a host who reads the world on purpose.
- It cannot protect the session from its own transport. See Bring your own transport.
- It cannot keep a hidden value secret from a database every player has. Start values and graphs you wrote are on every machine. See Who sees what.
- A save someone else made is untrusted. The host reads it as its own.
Not tested: Relay, a host on the internet, and an encrypted connection.
How it connects
Section titled “How it connects”- Settings reference: every limit named above.
- Seats, joining and waiting.
- Limits and what is not verified.