Skip to content

browser: move CDP off a TCP port onto --remote-debugging-pipe #459

Closed

Description

@ElbertePlinio

SECURITY.md lists "moving CDP off a TCP port onto --remote-debugging-pipe" as planned hardening tracked separately, but no issue tracked it. Checked while planning #454.

Today the session's Chrome serves CDP on a loopback TCP port. Any local process of the same user can connect to it, and after a session ends another process can take the freed port. A pipe removes the port.

It is not a small change with the current pieces:

  • chrome-devtools-mcp 1.5.0 connects to a running Chrome only through --wsEndpoint or --browserUrl. It uses a pipe only when it launches Chrome itself.
  • The session's Chrome is started by the browser supervisor (packages/browser/src/supervisor.ts), so the pipe file descriptors 3 and 4 belong to that process, not to the relay.
  • packages/browser/src/devtools.ts and session status probe /json/version over the port.

Design, chosen 2026-10-29: the supervisor starts Chrome with --remote-debugging-pipe, owns fds 3 and 4, and serves CDP on a 0600 Unix socket in the session's short temp alias. The relay connects to it with a ws+unix: endpoint, which chrome-devtools-mcp passes through puppeteer to ws. Owner decisions:

  1. cdpPort is removed from session records, create and status output, CLI text and MCP results.
  2. One relay per session. A second relay gets a clear "already attached" error.
  3. A session created before this change still runs and can be destroyed, but the relay refuses it and says to destroy and recreate it.
  • Choose a design: a Pickforge bridge that owns the pipe and serves the relay, or an upstream transport option in chrome-devtools-mcp
  • Start Chrome on the pipe and serve CDP on the session's Unix socket, one client at a time
  • Move the status probe and the DevTools helpers off the port
  • Remove cdpPort from records and output
  • Refuse legacy TCP sessions in the relay, with teardown still working
  • Test with real Chrome: relay, reconnect, named-profile close, supervisor kill, no TCP endpoint
  • Update SECURITY.md and the READMEs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions