T09 · Insecure Skill Coding Practices
- Location
src/server.ts:622- Finding
Unauthenticated live screen access and remote control are enabled by default
- Content
View full analysis
{ activeSockets.add(ws); if (config.mode !== "vnc") { ws.close(4004, "VNC mode disabled"); activeSockets.delete(ws); return; } const token = getTokenFromCookie(req); if (config.password && (!token || !validTokens.has(token))) { ws.close(4001, "Not authenticated"); activeSockets.delete(ws); return; } status = "active"; const tcp = new Socket(); tcp.connect(config.vncPort || 5900, config.vncHost || "localhost", () => { vncSocket = tcp; }); tcp.on("data", (data: Buffer) => { if (ws.readyState === WebSocket.OPEN) { ws.send(data); } }); ws.on("message", (data: Buffer) => { if (!tcp.destroyed) { tcp.write(data); } }); }); ``` ```ts screenWss.on("connection", async (ws: WebSocket, req: IncomingMessage) => { activeSockets.add(ws); if (config.mode !== "cdp") { ws.close(4004, "CDP mode disabled"); activeSockets.delete(ws); return; } const token = getTokenFromCookie(req); if (config.password && (!token || !validTokens.has(token))) { ws.close(4001, "Not authenticated"); activeSockets.delete(ws); return; } status = "active"; const cdp = new CdpClient({ host: config.cdpHost || "localhost", port: config.cdpPort || 9222, ...[truncated 2945 chars]- Remediation
View remediation
