T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/log-streamer.js:36- Finding
Unauthenticated Remote Control of a Permission-Bypassed Claude Process
- Content
View full analysis
body += c); req.on('end', () => { try { const { command } = JSON.parse(body); if (!command) { res.writeHead(400); res.end('{}'); return; } const ok = sendToCC(command); res.writeHead(ok ? 200 : 503, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ sent: ok })); } catch (e) { res.writeHead(400); res.end(JSON.stringify({ error: e.message })); } }); return; } ``` ```javascript ws.on('message', (data) => { const text = data.toString(); if (text === 'ping') { ws.send(JSON.stringify({ type: 'pong' })); } else if (text === 'sync') { const history = getHistory(); if (history) ws.send(JSON.stringify({ type: 'data', data: history })); } else if (text.startsWith('cmd:')) { const cmd = text.slice(4); const ok = sendToCC(cmd); ws.send(JSON.stringify({ type: 'cmd-status', ok })); } }); ``` ```javascript server.listen(PORT, '0.0.0.0', () => { console.log(`Log-Streamer v3 running on http://0.0.0.0:${PORT}`); if (NO_CC) { console.log('--no-cc mode: CC not started. Use POST /api/restart to start later.'); } else { console.log('Starting CC via node-pty...'); startCC(); } }); ``` ### Technical Analysis The service listens on every network interface and does not authenticate or authorize HTTP or WebSocket clients. Bot ...[truncated 1873 chars]- Remediation
View remediation
