Skip to content

browser: drain in-flight DevTools relay calls before session teardown #454

Closed

Description

@ElbertePlinio

Found while fixing #444 (PR #452).

The DevTools relay takes no agent permit for a forwarded tools/call, so session teardown does not wait for a relay call that is already running. Desktop input calls do get that wait. A call that passed the relay's session check just before teardown can therefore still be in flight, or still queued in the chrome-devtools-mcp child, when Chrome exits. If it connects after that, a local process that took the freed loopback port could answer it. SECURITY.md documents this window, and the threat model already gives local processes control over loopback CDP, but draining in-flight calls would close the ordinary case.

  • Hold an agent permit for each forwarded tools/call until its response, so teardown drains relay calls before it stops Chrome
  • Test a call in flight across session destroy
  • Consider moving CDP to --remote-debugging-pipe, the planned hardening in SECURITY.md, which removes the port (considered; tracked in browser: move CDP off a TCP port onto --remote-debugging-pipe #459)
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