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(ssh): refuse or escape PowerShell smart quotes in a Windows --remote-bin #56
Security and stability hardening audit finding TS-08 / Low (2026-09-28). Priority is an audit recommendation, not a claim of a production incident.
For --remote-platform win32, --remote-bin is validated with ^[A-Za-z]:\\[^\r\n]+$ and embedded in a PowerShell single-quoted string by doubling ASCII ' only. PowerShell also treats U+2018, U+2019, U+201A and U+201B as single-quote delimiters. A value such as C:\a’;calc;# produces the encoded command & 'C:\a’;calc;#' --version, which PowerShell tokenizes as a closed string followed by calc.
Confirmed by decoding the generated -EncodedCommand; not executed (no PowerShell in the audit environment).
What you expected
Either restrict --remote-bin for Windows to printable ASCII (as the POSIX branch already does) or escape all PowerShell single-quote characters.
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: stub ssh executable capturing argv; no network connection.
Source evidence
src/cli.ts#L76-L79 — Windows validation allows any non-newline character
Smart single quotes in a Windows --remote-bin are refused or escaped.
Unit test decoding the generated encoded command for each quote variant.
Scope and limitations
Hardening only: --remote-bin is supplied by the caller, who already has SSH access to the remote host, and it cannot be set through a Reply-To URI. No privilege boundary is crossed.
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)