Skip to content

Browser: Chrome's DevTools port is reachable from networked sandboxes #517

Open

Description

@lydakis

Found in the review of #515 (thread).

The edge

agent-browser 0.27 starts Chrome with --remote-debugging-port=0, which opens a DevTools listener on a random loopback TCP port. It has no pipe option.

A workspace-write sandbox with network on shares the host's loopback on both platforms, as Codex's does (src/sandbox.rs). An agent there could scan loopback, find that port, and drive Chrome over CDP directly. That gets around everything the browser tool checks:

  • paths, including downloads to any folder
  • confirmations
  • other agents' sessions and sign-ins

Refusing get cdp-url only hides the address.

Agents without network, or the read-only ones, can't reach the port. The browser tool also gates every call of an agent kept off the network.

Options

  1. Pipe, not a port. Ask agent-browser upstream for --remote-debugging-pipe. Playwright uses a pipe by default, which is why Playwright's MCP server doesn't have this problem. This is the tried-and-true answer.
  2. Sandbox loopback rules.
    • On macOS, Seatbelt could deny outbound to loopback ports the agent didn't open. This is hard to tell apart from the agent's own dev servers.
    • On Linux, the sandbox could give a networked agent its own network namespace with a forwarding proxy, the way Codex's managed network works.
  3. Chrome in its own network namespace on Linux, reached through the host's socket only.

Recommended: (1) upstream, with (2) as the general fix for loopback services. The same exposure applies to any unauthenticated local service the person runs, not only Chrome.

Activity

  1. lydakis commented on Oct 31, 2026

    @lydakis
    OwnerAuthor

    Update after #526: an agent with the network on now reaches every Unix socket, as Codex's full network does. That includes agent-browser's daemon socket, whose launch takes an executable path, so this issue covers it as well as Chrome's DevTools port. Both are processes outside the sandbox that a networked agent can reach. Codex accepts reachable localhost services, so this stays open as a known edge, not a blocker. The fix would be pipe-based DevTools (--remote-debugging-pipe, as Playwright does) and a socket folder the sandbox can't see, once agent-browser supports a pipe.


    Generated by Claude Code

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