Summary
Game server crashes when this.player.stateBuffer[idx] is undefined during sync processing.
Affected Code
server-game/src/client.js:317-319
for (startIdx, i = 0; i < FramesBetweenSyncs; i++) {
var idx = Math.mod(startIdx + i, stateBufferSize);
this.player.stateBuffer[idx].controlKeys = input.unPackInt8U();
this.player.stateBuffer[idx].yaw = input.unPackRadU();
this.player.stateBuffer[idx].pitch = input.unPackRad();
// CRASH if stateBuffer[idx] is undefined
}
Vulnerability
If player initialization incomplete or buffer not properly allocated.
Impact
- Game server crash on sync packet
- Denial of service
Recommended Fix
if (!this.player.stateBuffer[idx]) {
console.error('stateBuffer not initialized at index', idx);
return;
}
this.player.stateBuffer[idx].controlKeys = input.unPackInt8U();
References