Skip to content
A Local Tool With No Login Still Needs a Host Check

31 October 2026 · 2 min read

A Local Tool With No Login Still Needs a Host Check

securitynodejsprojects

working-agents is a local dev tool. It has no authentication and it serves your Claude Code session data over a WebSocket. Binding it to 127.0.0.1 feels like it settles the security question, but the browser is on the same machine, and a page you opened from anywhere can send requests to localhost.

What loopback does not stop#

Two things are easy to forget:

  • a web page can open a WebSocket to ws://localhost:4242 or POST to it, and your browser will happily do so;
  • with DNS rebinding, a hostname the attacker controls can be made to resolve to 127.0.0.1, so the request looks same-origin to the browser while the Host header still carries the attacker's name.

For a tool that exposes session data and accepts a /hook endpoint that updates state, both matter.

The guard#

The server keeps a small allow-list built at startup: localhost, 127.0.0.1 and [::1], each with the port, plus the configured bind host unless that is 0.0.0.0 or ::. Then one function decides every request:

  • the Host header must be in the list, which defeats rebinding because the attacker's hostname is not;
  • if an Origin header is present, its host must be in the list too, which blocks other pages from reading the WebSocket or forging hook events.

The same function guards plain HTTP requests (answered with a 403) and the WebSocket handshake, through verifyClient.

Two smaller hardening steps#

  • Static files are served from the client directory only: the requested path is decoded, resolved against the root and rejected unless the result is inside the root, and a null byte is rejected outright.
  • The hook endpoint stops reading a request body once it passes 100 KB.

What it does not claim#

There is still no authentication, and the README says so plainly: do not bind it to 0.0.0.0 on an untrusted network. The checks are about not letting other web pages in your own browser turn a harmless local dashboard into an information leak.

These were fixes, not initial design. The first version bound loopback by default but did not check headers, which is a good reminder that "it only runs locally" is a deployment fact, not a threat model.