Reject option-like SSH destinations and terminate ssh options

main

Commit

Soph2mo ago

sshInvocationArgs built ssh -o BatchMode=yes [-p port] <destination> <command> with no -- separator and no validation of the destination, which comes straight from the URL. A URL like ssh://-oProxyCommand=evil/repo made ssh parse the destination as an option — ProxyCommand means arbitrary local command execution (git's CVE-2017-1000117 class).

Reject any host, username, or port that begins with - (the portable primary guard, matching git's own fix), and insert -- before the destination as defense in depth so options can never run past it. Update the ssh test shim to skip the new -- so the invocation assertions are unchanged, and add coverage for both the rejection and the -- placement.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 191ffd473fdb

Checkpoints

Review the code changes against the base branch 'main'. The merge base commit for this comparison is 368750cee35f31935640a34ad199e889fc60f1a8. Run `git diff 368750cee35f31935640a34ad199e889fc60f1a8` t

CodexGPT-5.5
View session
Checkpoint 1

Use a real Windows lock for the file token store

CodexGPT-5.5
View session
Checkpoint 1

just remove .clawpatch from the commit but then just delete the folder, we don't need to keep it

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1

Review the code changes against the base branch 'main'. The merge base commit for this comparison is 368750cee35f31935640a34ad199e889fc60f1a8. Run `git diff 368750cee35f31935640a34ad199e889fc60f1a8` t

CodexGPT-5.5
View session
Checkpoint 1