Skip to content

Browser: pin agent-browser outside every agent's writable folders, not just the caller's #614

Closed

Description

@lydakis

Found by #515's security review (thread), left open at merge. It's filed here so #531 can close.

The edge

Sonny's tool host pins agent-browser once from PATH (b0e3de8). Before each call, it refuses to run the pinned program if its real path is inside a folder the calling agent can write. It doesn't check the other agents' folders.

Here's how that goes wrong:

  1. PATH resolves agent-browser inside a folder that agent A can write.
  2. Agent B, which uses the browser and has different folders, makes an ordinary browser call.
  3. If A has replaced the executable, B's call runs A's program in the unsandboxed tool host. That happens before any confirmation.

Who it reaches

Only installs where agent-browser lives inside some agent's writable folder, such as a project's node_modules/.bin or .venv/bin that is on PATH. A Homebrew or system install isn't reachable.

Fix proposed in the thread

Pin the content, not the path. When the tool host pins the program, copy the binary into Sonny's private folder, and always run that copy.

npm's JS launcher complicates this, because it finds its native binary next to itself. The copy would need to be of the resolved native binary, or else refuse any path that is under any agent's writable folders.

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