security: block cross-site access to privileged localhost routes #361

Closed
opened 2026-07-16 21:03:43 +02:00 by dries · 0 comments
Owner

What to build

Prevent websites from treating the browser's loopback connection as trusted access to ocman. Privileged localhost HTTP, MCP, workflow, terminal-management, and terminal WebSocket operations must require an authenticated same-origin request rather than trusting only the TCP peer.

Acceptance criteria

  • Requests from a foreign browser Origin cannot reach privileged localhost mutation routes.
  • The terminal WebSocket rejects foreign origins and remains usable from the ocman UI.
  • Browser-safe request validation covers REST, workflow, MCP, and WebSocket entry points consistently.
  • Regression tests demonstrate that a hostile origin cannot publish/start a command workflow or attach to a terminal.
  • Normal local development, authenticated remote UI access, SSE, and terminal use continue to work.

Blocked by

None - can start immediately.

## What to build Prevent websites from treating the browser's loopback connection as trusted access to ocman. Privileged localhost HTTP, MCP, workflow, terminal-management, and terminal WebSocket operations must require an authenticated same-origin request rather than trusting only the TCP peer. ## Acceptance criteria - [ ] Requests from a foreign browser Origin cannot reach privileged localhost mutation routes. - [ ] The terminal WebSocket rejects foreign origins and remains usable from the ocman UI. - [ ] Browser-safe request validation covers REST, workflow, MCP, and WebSocket entry points consistently. - [ ] Regression tests demonstrate that a hostile origin cannot publish/start a command workflow or attach to a terminal. - [ ] Normal local development, authenticated remote UI access, SSE, and terminal use continue to work. ## Blocked by None - can start immediately.
dries closed this issue 2026-07-17 13:17:48 +02:00
Sign in to join this conversation.
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
dries/ocman#361
No description provided.