Skip to content

fix(macos): never save a jump host's SSH password for the destination - #273

Merged
akonwi merged 1 commit into
mainfrom
fix/macos-ssh-jump-password
Oct 23, 2026
Merged

akonwi merged 1 commit into
mainfrom
fix/macos-ssh-jump-password

Conversation

@akonwi

@akonwi akonwi commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Fixes #270, found in the macos-v0.6.0 release review.

Problem

SSHAttempt.answer kept every password answer, whatever account the prompt named. The sign-in sheet offered Save in Keychain on a ProxyJump host's password too, and keep() saved it under the destination. The next time the destination asked, Kit sent it the jump host's password. Separately, the retry counter was keyed only by "password", so the destination's first question after a jump host's said "That password didn't work."

Change

  • SSHPromptRequest.canSave: false for another account's password. The sheet then hides Save in Keychain and says "Kit sends it to ssh and doesn't keep it."
  • SSHAttempt keeps a password answer only for the login account (isLogin: no account named, or user@hostname from ssh -G), the same rule that already governed sending a saved password.
  • Retries are counted per account.
  • Removed SSHPrompt.saveable, which only a test used and which now misstated the rule.
  • ADR 0045 and docs/features/attach.md say only the login account's password can be saved.

Tests

  • aJumpHostsPasswordIsNeverSavedForTheDestination: jump host, then destination; only the destination's password is saved, and neither question is a retry.
  • aJumpHostsPasswordAloneIsNeverSaved: a jump host's password with Save chosen leaves the Keychain empty.
  • aStaleSavedPasswordBehindAJumpHostIsDroppedNotReplacedByTheJumpHosts: the stale saved password goes only to the destination, and the user's new answer replaces it.
  • anotherAccountsPasswordCantBeSaved: the sheet has no save toggle and the adjusted message.

The first two fail with the behavior change reverted. Full xcodebuild … test: 1000 tests pass. generate_openapi.sh --check, bash -n on the scripts, and git diff --check pass.

The code-reviewer subagent found no blocking issues. Its two low findings are pre-existing and filed as a follow-up.

SSHAttempt kept every password answer, so a ProxyJump host's password
could be saved under the destination and later sent to it. Keep and
offer to save only the login account's password, and count retries per
account so the destination's first question after a jump host's isn't
shown as a retry.

Closes #270
@akonwi
akonwi merged commit 3a75746 into main Oct 23, 2026
8 checks passed
@akonwi
akonwi deleted the fix/macos-ssh-jump-password branch October 23, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS SSH: a jump host's password can be saved as the destination's and sent to it

1 participant