Summary
Room initialization crashes when GameTypes[this.gameType] is undefined.
Affected Code
server-game/src/rooms.js:53-54
this.gameOptionsOriginal = JSON.parse(JSON.stringify(GameTypes[this.gameType].options));
this.gameOptions = JSON.parse(JSON.stringify(GameTypes[this.gameType].options));
// CRASH if GameTypes[this.gameType] is undefined
Vulnerability
If client sends invalid gameType index outside valid range.
Impact
- Game server crash on room creation
- Denial of service
Proof of Concept
Send joinGame with gameType: 999
Recommended Fix
const gameType = GameTypes[this.gameType];
if (!gameType) {
throw new Error(`Invalid game type: ${this.gameType}`);
}
this.gameOptionsOriginal = JSON.parse(JSON.stringify(gameType.options));
this.gameOptions = JSON.parse(JSON.stringify(gameType.options));
References
Summary
Room initialization crashes when
GameTypes[this.gameType]is undefined.Affected Code
server-game/src/rooms.js:53-54Vulnerability
If client sends invalid
gameTypeindex outside valid range.Impact
Proof of Concept
Send joinGame with
gameType: 999Recommended Fix
References