T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/token-monitor.js:336- Finding
Unauthenticated Network Exposure of Sensitive Session Telemetry
- Content
View full analysis
{ clients = clients.filter(c => c !== res); }); return; } if (pathname === '/api/daily') { const date = url.searchParams.get('date') || new Date().toISOString().slice(0,10); const summary = queryDailySummary(date); const sessions = querySessionsByDate(date); const hist = queryHistoryForDate(date); res.writeHead(200, {'Content-Type':'application/json','Access-Control-Allow-Origin':'*'}); res.end(JSON.stringify({ date, summary, sessions, history: hist })); return; } if (pathname === '/api/export') { if (!db) { res.writeHead(500); res.end('no db'); return; } try { const rows = db.exec(`SELECT * FROM daily_summary ORDER BY date DESC LIMIT 365`); const cols = rows.length ? rows[0].columns : []; const data = rows.length ? rows[0].values.map(v => { const o={}; cols.forEach((c,i)=>o[c]=v[i]); return o; }) : []; res.writeHead(200, {'Content-Type':'application/json','Access-Control-Allow-Origin':'*'}); res.end(JSON.stringify({ daily: data, exported_at: new Date().toISOString() })); } catch(e) { res.writeHead(500); res.end(e.message); } return; } server.listen(PORT, '0.0.0.0', () = ...[truncated 2266 chars]- Remediation
View remediation
