Skip to content

Bot shells can drive the terminal multiplexer (cmux, Herdr) outside the sandbox #304

Open

Description

@lydakis

Raised by the Codex security review on #300 (thread).

What: when the daemon was started inside cmux, a bot's shell inherits cmux's socket path and CMUX_SOCKET_CAPABILITY. The daemon strips only the place variables (CMUX_SURFACE_ID and the rest), so an ungated shell command can call cmux rpc surface.create with initial_input, or cmux send into a shell tab. That runs as the person, outside the task's sandbox, and can read other tabs.

Same class as Herdr: the herdr-panes skill already has agents drive Herdr from their shell, and Herdr's socket is reachable the same way. The cmux-tabs skill relies on this on purpose: agents read, wait on and stop their own tabs with the CLI.

Possible fix: strip the multiplexer's connection credentials (CMUX_SOCKET_CAPABILITY, CMUX_SOCKET_PATH, Herdr's socket) from bot environments, and broker scoped read, send and close calls through Sonny's gated tools (run_in_pane already creates tabs). That changes both skills.

Logged per the project's stance on security edges (log, don't block the PR), like #279.

Activity

  1. self-assigned this
    on Oct 28, 2026
  2. lydakis commented on Oct 29, 2026

    @lydakis
    OwnerAuthor

    This gets wider with cmux's Automation mode, which is the setting #323 tells cmux users to turn on so agents' shells can reach cmux. In that mode, every sandboxed shell call of every agent can run cmux send/read-screen on any tab. That includes the person's own unsandboxed shell tabs, so a confined shell call (which skips approval) can type a command into a host shell and escape the sandbox. The calls Sonny itself answers (run_in_pane, show_agent) are gated; direct CLI use from shells is not.

    A fix that keeps cmux's ancestry check would broker agents' cmux use (read, send and close on their own surfaces only) through Sonny's gated tools, answered by a lookout started inside cmux. George chose Automation mode for now (2026-10-29), so this is logged here rather than built.


    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

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