You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): refuse a known flag consumed as the value of a value-taking option #51
Security and stability hardening audit finding TS-03 / Low (2026-09-28). Priority is an audit recommendation, not a claim of a production incident.
For value-taking options (--to, --message/-m, --host, --codex-home, ...), the parser takes the next token unconditionally as the value, even when it is another known flag:
session-peer send --to bob --message --dry-run parses message="--dry-run", the dry-run flag is not set, and the literal text --dry-run is sent for real.
session-peer send --to --dry-run hi is accepted with to="--dry-run".
This typically happens with an empty or unquoted shell variable (--message $BODY --dry-run). The Python v1 reference (argparse) rejects the same inputs with "expected one argument" (exit 2).
What you expected
A value that is exactly a known flag name is rejected as invalid_option (exit 2). Bodies that start with - remain possible through --message=<text>, stdin, or a positional argument after --.
Environment
Baseline: published session-peer 0.2.0 (npm latest), repository commit 38a1300369443e064f58bb18e8bda70f31af0fbb.
Audit environment: macOS arm64, Node 22.14.0.
No live message tests or production mutation.
Reproduction: synthetic HOME with no sessions; commands run with --json.
Source evidence
src/cli.ts#L32-L36 — args[++i] taken as the value without checking whether it is a flag
Acceptance criteria
--message --dry-run, --to --dry-run, --host --json and similar are refused with exit 2 before any delivery.
--message=--dry-run and -- -text still work and are covered by tests.
Behaviour documented in help / PARITY.md.
Scope and limitations
Caller-controlled input only; no privilege boundary is crossed. The concern is an unintended real send when a dry run was intended.
Checked
Searched existing issues in this repository and in abruption/session-peer for duplicates.
Removed credentials, conversation contents, private paths and real device/session identifiers.
Used isolated fixtures without weakening inbound permissions.
Activity
fix: harden Codex delivery, CLI parsing, SSH and output (#49-#57) (#62)