Skip to content

fix(ssh): enforce the encoded UTF-8 command argument budget #207

Closed

Description

@abruption

What happened

Stability audit finding F08 / P2 (2026-09-27). Priority is an audit recommendation, not a claim of a production incident.

Remote message validation limits characters (90,000), while transmission encodes UTF-8 as base64 inside a single remote-command argument. 40,000 Korean characters fit the character limit but produce 160,000 base64 bytes. A 90,000-character synthetic input passed validation and produced a 360,041-byte remote command.

A separate benign Linux diagnostic (no session send) found a 120,000-byte argument to /bin/true succeeded, while 160,000 bytes raised OSError errno 7 (E2BIG) on a 4,096-byte-page system. This matches Linux's per-string 32-page argv limit. The same size may be accepted by macOS, so local-only tests miss the destination failure.

What you expected

Validate an encoded byte budget that accounts for envelope/base64/command overhead and platform constraints, or use a separately reviewed stdin transport. A precise early refusal is the minimal patch scope.

Environment

  • Baseline: published session-peer v1.0.1, commit 55168c3bea5a49e81916fdead57d3634def6b1d6.
  • Reproduction: isolated source/tag fixtures; no live message/ACK tests or production mutation.
  • Audit environments: macOS arm64, Python 3.14.7; Control tests use Node 22.14.0. Linux evidence is explicitly identified above where applicable.
  • Discovery output: not applicable to this fixture; no real session identifiers or credentials are included.

Source evidence

Acceptance criteria

  • Exercise ASCII and multibyte UTF-8 around encoded boundaries, including envelope overhead.
  • Accepted inputs must fit the supported SSH invocation contract; oversized input must fail clearly before delivery.
  • Check local/SSH behavior and avoid weakening existing message-size controls.

Scope and limitations

Reference: https://man7.org/linux/man-pages/man2/execve.2.html. This is not the SSH identity feature in #183.

Target: v1.0.2 stability work. This issue does not authorize a release or operating-service changes. Offline reproduction establishes the failure mechanism, not attribution of historical #161 incidents.

Checked

  • Searched existing issues for duplicates.
  • Removed credentials, conversation contents, private paths and real device/session identifiers.
  • Used isolated fixtures without weakening inbound permissions.

Activity

  1. added this to the v1.0.2 milestone on Sep 27, 2026
  2. added
    bug
    on Sep 27, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions