Skip to content

Close websocket and Upgrade-header auth bypasses - #412

Merged
Priyanshu-u07 merged 1 commit into
mainfrom
fix/websocket-auth-bypass
Oct 17, 2026
Merged

Priyanshu-u07 merged 1 commit into
mainfrom
fix/websocket-auth-bypass

Conversation

@Priyanshu-u07

Copy link
Copy Markdown
Collaborator

Closes several ways to reach internal endpoints, worker shells and log streams without the right auth.

  • Internal endpoints require the internal key on every request. The Upgrade-header exemption is removed from the gateway's internal-key and login middleware: an HTTP middleware never sees a real WebSocket handshake, so no legitimate traffic used it.
  • Orchestration checks the internal key on WebSocket connections the same way as HTTP, and /deployment/ws is no longer exempt. The gateway's relays already send the key; the worker channel keeps its own token check.
  • The node shell requires a new node:shell permission. Admins have it, the default member role does not, and in external auth modes it maps to the admin catalog key. The dashboard hides the Shell link and tab without it.
  • Orchestration refuses shell and node-log connections for nodes outside the caller's organisation.

Tests cover each change and fail when it is removed. The related auth, websocket and worker suites pass; the gateway suite's remaining failures also fail on main.

Verified on a local stack: the gateway and orchestration checks fail on main (5 of 11 pass) and all pass on this branch, and only the admin role holds node:shell after startup. Org scoping against a live worker and the dashboard changes are covered by tests but not yet run live.

Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
@Priyanshu-u07

Copy link
Copy Markdown
Collaborator Author

Verified end to end on a local stack with a real worker:

  • Upgrade-header bypasses: refused on this branch, reproduced on main.
  • Orchestration websockets without the key, or with the key but no org: refused.
  • Org scoping on a live node: another org refused, the owning org accepted, for shell and logs.
  • Worker channel connects and the node stays ready.
  • Admin opens the shell and logs from the dashboard. A member gets no Shell tab, /shell redirects, and a direct gateway connection is refused with 403. Members can still read logs.
  • Only the admin role holds node:shell after startup.

@Priyanshu-u07
Priyanshu-u07 merged commit b797810 into main Oct 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant