Skip to content

Command injection: --to reaches the remote shell, --host/--ssh-opt reach the local one #6

Closed

Description

@abruption

Two injection paths, both reproduced.

1. --to is interpolated into the remote shell

run_remote() builds ["ssh", *ssh_opts, host, "python3", "-", *argv, "--json"]. ssh joins everything after host with spaces and hands it to the remote login shell. --b64 survives because it's base64, but --to is passed raw and unquoted.

Reproduced KR→US and again from this laptop: a shell metacharacter in --to executes on the far side, and the marker came back in the error output. --dry-run does not prevent it, because the injection happens in the ssh layer before any of our logic runs.

Why this matters more than it looks: SKILL.md has Claude pick the target session name itself. When that name originates from untrusted input — a received cross-session message, a web page, a file — this is remote command execution. The README currently advertises, as an advantage over tmux send-keys, that quotes and $ never reach a shell. That claim holds for the message body but not for --to.

Also breaks ordinary use: a session named my session resolves as my.

2. --host and --ssh-opt are passed to ssh unvalidated

A value starting with - is parsed by ssh as an option, so ProxyCommand can be injected and runs locally. Confirmed via the local execution signature (Connection closed by UNKNOWN port 65535).

This widens the blast radius of a Bash(cc-peer:*) allowlist from "can message sessions" to "can run arbitrary local and remote commands". The README's "not a privilege-escalation path" is true of the socket, not of these flags.

Fix

  • Quote the remote argv (shlex.quote) so nothing but the intended command reaches the remote shell
  • Reject --host / --ssh-opt values beginning with -
  • State the flag trust boundary in the README

Verified on v0.2.0, macOS 26 → Ubuntu 24.04.

Activity

  1. added
    bug
    on Sep 7, 2026
  2. abruption commented on Sep 7, 2026

    @abruption
    OwnerAuthor

    Fixed in #11 — both paths reproduced before and confirmed closed after, and deployed to all four machines.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions