T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/OpenClawGameBridge.js:34- Finding
Unauthenticated WebSocket Interface Permits Client Impersonation and Game Control
- Content
View full analysis
{ console.log('[Bridge] New client connection'); ws.isAlive = true; ws.on('pong', () => { ws.isAlive = true; }); ws.on('message', (data) => { try { const msg = JSON.parse(data); console.log('[Bridge] Message received:', msg.type, JSON.stringify(msg).substring(0, 200)); this.handleMessage(msg, ws); } catch (error) { console.error('[Bridge] Message parsing error:', error); } }); }); } ``` ```javascript onBridgeSendCommand(ws, msg) { const playerUid = msg.playerUid; const command = msg.command; if (!playerUid || !command) { console.log(`[Bridge] sendCommand missing parameters: playerUid=${playerUid}, command=`, command); return; } const targetWs = this.clients.get(playerUid); if (!targetWs || targetWs.readyState !== WebSocket.OPEN) { console.log(`[Bridge] sendCommand player offline: ${playerUid}`); return; } targetWs.send(JSON.stringify({ type: 'ai_control', playerUid: playerUid, command: command })); } ``` ```javascript onClientRegister(msg, ws) { let playerUid = msg.playerUid; if (!playerUid || playerUid === '') { playerUid = 'player_001'; } this.clients.set(playerUid, ws); ws.send(JSON.stringify({ type: 'ai_registered', playerUid: playerUid, status: 'ok' })); } ``` ### Technical Analysis The WebSocket server is created without an explicit loopback host, authentication cal ...[truncated 2729 chars]- Remediation
View remediation
