plan: the server binds every interface, answers any Origin, and has no test for either (#1527) #1592

Merged
jaylouisw merged 1 commit from plan/1116-0310 into main 2026-11-16 04:53:41 +00:00
Owner

Forward plan only, no code. New docs/plans/server-exposure.md.

What it plans, in five one-PR steps:

  1. PF_HOST, default 127.0.0.1, logged via server.address(); Dockerfile sets PF_HOST=0.0.0.0 so the published image keeps working. S
  2. An Origin/Host guard on the WebSocket upgrade (server/index.js:1418, server/ws.js:21), absent Origin allowed, PF_ALLOWED_ORIGINS escape hatch, 403 before the 101. S/M
  3. Narrow the CORS wildcard: keep it on the two immutable public endpoints, echo an allowed Origin for board data. M
  4. Drop the unsolicited default-board push on connect; the client sends the subscribe it never sent. S
  5. Rewrite SECURITY.md:35-43, ARCHITECTURE.md and README.md to match. S

The plan deliberately leaves out the bearer token (item 3 of #1527): there is no credential store yet, so it would protect nothing and needs Jay's approval when it lands.

Evidence gathered from main: server.listen(PORT) with no host, Access-Control-Allow-Origin: * on every JSON answer (the REST read path #1527 does not mention), and two server-spawning tests that only ever poll 127.0.0.1, so a 0.0.0.0 default is invisible.

Forward plan only, no code. New `docs/plans/server-exposure.md`. What it plans, in five one-PR steps: 1. `PF_HOST`, default `127.0.0.1`, logged via `server.address()`; Dockerfile sets `PF_HOST=0.0.0.0` so the published image keeps working. S 2. An `Origin`/`Host` guard on the WebSocket upgrade (`server/index.js:1418`, `server/ws.js:21`), absent Origin allowed, `PF_ALLOWED_ORIGINS` escape hatch, 403 before the 101. S/M 3. Narrow the CORS wildcard: keep it on the two immutable public endpoints, echo an allowed Origin for board data. M 4. Drop the unsolicited default-board push on connect; the client sends the `subscribe` it never sent. S 5. Rewrite `SECURITY.md:35-43`, `ARCHITECTURE.md` and `README.md` to match. S The plan deliberately leaves out the bearer token (item 3 of #1527): there is no credential store yet, so it would protect nothing and needs Jay's approval when it lands. Evidence gathered from main: `server.listen(PORT)` with no host, `Access-Control-Allow-Origin: *` on every JSON answer (the REST read path #1527 does not mention), and two server-spawning tests that only ever poll 127.0.0.1, so a `0.0.0.0` default is invisible.
plan: the server's default exposure - every interface, a CORS wildcard, no Origin check (#1527)
All checks were successful
CI / Classify the change (pull_request) Successful in 25s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 43s
CI / Test (Node 18) (pull_request) Successful in 1m53s
CI / Test (Node 20) (pull_request) Successful in 1m48s
CI / Server smoke test (pull_request) Successful in 35s
CI / Docker build (pull_request) Successful in 37s
CI / Test (Node 22) (pull_request) Successful in 1m43s
c698779857
jaylouisw force-pushed plan/1116-0310 from c698779857
All checks were successful
CI / Classify the change (pull_request) Successful in 25s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 43s
CI / Test (Node 18) (pull_request) Successful in 1m53s
CI / Test (Node 20) (pull_request) Successful in 1m48s
CI / Server smoke test (pull_request) Successful in 35s
CI / Docker build (pull_request) Successful in 37s
CI / Test (Node 22) (pull_request) Successful in 1m43s
to 7568ef7ba2
Some checks failed
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 53s
CI / Classify the change (pull_request) Failing after 13m43s
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Server smoke test (pull_request) Has been cancelled
CI / Docker build (pull_request) Has been cancelled
2026-11-16 04:37:25 +00:00
Compare
jaylouisw force-pushed plan/1116-0310 from 7568ef7ba2
Some checks failed
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 53s
CI / Classify the change (pull_request) Failing after 13m43s
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Server smoke test (pull_request) Has been cancelled
CI / Docker build (pull_request) Has been cancelled
to 0eb4065714
Some checks failed
PR rebase / Rebase onto main and arm auto-merge (pull_request) Failing after 14m33s
CI / Classify the change (pull_request) Failing after 14m58s
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Server smoke test (pull_request) Has been cancelled
CI / Docker build (pull_request) Has been cancelled
2026-11-16 04:51:39 +00:00
Compare
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 04:51:53 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1592
No description provided.