Summary
Room manager crashes when worker sends malformed message array.
Affected Code
server-game/src/roomManager.js:201
worker.on('message', (msg) => {
const [ msgType, content, wsId ] = msg; // CRASH if msg is not array or too short
Vulnerability
If worker sends non-array or incomplete array, destructuring fails.
Impact
- Game server crash on worker communication
- Room becomes unresponsive
Recommended Fix
worker.on('message', (msg) => {
if (!Array.isArray(msg) || msg.length < 3) {
console.error('Invalid worker message format:', msg);
return;
}
const [ msgType, content, wsId ] = msg;
References