Files
romm/docs
Sam Dornan 34a0fbfa75 fix(security): authorize netplay socket room events
The netplay namespace served /netplay/socket.io with no identity at all: any
client, from any origin, could open a room, join one, and relay WebRTC signals
to any socket id it named, with the ROM id and the player identity supplied
entirely by the client.

The socket now resolves its user from the session cookie once, at connect, into
the server-side socket session, the same way the main /ws namespace does.
open-room requires that user to hold roms.read and to be allowed to see the
ROM being played, which is the gate the ROM endpoints apply. join-room accepts
an anonymous client only when it supplies the room password the owner set, the
invite path a guest uses; otherwise it applies the same ROM gate. WebRTC
signals relay only to peers of the caller's own room.

The connect handler never refuses a connection, so guest joins keep working.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 10:42:47 -05:00
..