Summary
Game server crashes when roomFound object is missing expected properties.
Affected Code
server-game/start-game.js:98-101
if (roomFound) {
if ((roomFound.ready) && roomFound.playerCount >= roomFound.playerLimit) {
// CRASH if roomFound.playerCount or roomFound.playerLimit undefined
ws.close(Comm.Close.gameFull);
Vulnerability
If RoomManager.searchRooms returns incomplete room object.
Impact
- Game server crash on join attempt
- Denial of service
Recommended Fix
if (roomFound?.ready &&
typeof roomFound.playerCount === 'number' &&
typeof roomFound.playerLimit === 'number' &&
roomFound.playerCount >= roomFound.playerLimit) {
References