T05 · Unauthorized Access and Privilege Escalation
- Location
workbench-runtime/dist-server/index.mjs:38440- Finding
Unauthenticated Network-Exposed Workbench API Permits Privileged Operations
- Content
View full analysis
str: if args.host.strip(): return args.host.strip() env_host = _clean_env("WORKBENCH_HOST") if env_host: return env_host # Forwarding/canvas URLs usually proxy from localhost. Without one, expose # all interfaces only in container-like environments where localhost points # at the wrong network namespace for the user. if public_url: return "127.0.0.1" return "0.0.0.0" if _looks_like_docker_or_wsl() else "127.0.0.1" ``` The server initializes its routes without an authentication or authorization middleware: ```js var app = (0, import_express.default)(); var port = Number.parseInt(process.env.PORT ?? "8787", 10); var host = process.env.HOST ?? process.env.WORKBENCH_HOST ?? "127.0.0.1"; var server = null; var shutdownScheduled = false; app.use(import_express.default.json({ limit: "50mb" })); ``` An unauthenticated caller can terminate the service: ```js app.post("/api/workbench/shutdown", (_request, response) => { const payload = { ok: true, pid: process.pid, message: shutdownScheduled ? "Workbench server shutdown is already scheduled." : "Workbench server is shutting down." }; response.once("finish", scheduleShutdown); response.json(payload); }); ``` The same unauthenticated API can send messages through the configured credentialed agent bridge: ```js app.post("/api/chat/send", async (request, response, next) => { try { const message = requireString(request.body?.message, "message"); const result = await sendWorkbenchChat(message, request.body?.context); response ...[truncated 5895 chars]- Remediation
View remediation
