T05 · Unauthorized Access and Privilege Escalation
- Location
bridges/local-bridge-server.mjs:14- Finding
Unauthenticated Local Bridge Exposes Bookmark Data and Mutation Operations
- Content
View full analysis
{ try { if (req.method === "GET" && req.url === "/health") { return sendJson(res, 200, buildHealthPayload()); } if (req.method === "POST" && req.url === "/context") { return sendJson(res, 200, await forwardToExecutor({ type: "bridge.context", ...(await readJsonBody(req)) })); } if (req.method === "POST" && req.url === "/validate") { return sendJson(res, 200, await forwardToExecutor({ type: "bridge.validate", ...(await readJsonBody(req)) })); } if (req.method === "POST" && req.url === "/apply") { return sendJson(res, 200, await forwardToExecutor({ type: "bridge.apply", ...(await readJsonBody(req)) })); } if (req.method === "POST" && req.url === "/undo") { return sendJson(res, 200, await forwardToExecutor({ type: "bridge.undo", ...(await readJsonBody(req)) })); } if (req.method === "POST" && req.url === "/cleanup-test-artifacts") { return sendJson(res, 200, await forwardToExecutor({ type: "bridge.cleanup_test_artifacts", ...(await readJsonBody(req)) })); } ``` ```js server.on("upgrade", (req, socket, head) => { if (req.url !== "/ws") { socket.destroy(); return; } wss.handleUpgrade(req, socket, head, (ws) => { wss.emit("connection", ws, req); }); }); wss.on("connection", (ws) => { ws.on("message", (raw) => { let payload; try { payload = JSON.parse(String(raw)); } catch (error) { return; } if (payload?.type === "hello" && payload?.role === "chrome-executor") { executorSocket = ws; lastExecutorSeenAt = Date.now(); ...[truncated 4005 chars]- Remediation
View remediation
