-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
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 undefinedVulnerability
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels