fix(ssh): add host key verification to SSH client#1227
Merged
Conversation
Closes #1171 — The RusshHandler previously accepted all server keys without verification (MITM vulnerability). Now: - strict_host_key_checking defaults to true - Connections rejected unless server key matches a trusted key - SshConfig::trusted_host_key() API for configuring known keys - Warning emitted when strict checking is disabled
…ample The ssh_supabase_tests and ssh_supabase example didn't configure strict_host_key_checking(false), causing CI failures when the new default-strict host key verification rejects the supabase.sh connection (no trusted key configured).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1171
strict_host_key_checkingdefaults totrue— connections rejected unless server key matches a trusted key configured viaSshConfig::trusted_host_key()keys_match()compares key type+data, ignoring trailing commentsTest plan
test_strict_host_key_checking_default_true— default is stricttest_strict_host_key_checking_disabled— can opt outtest_trusted_host_key_builder— API stores keys correctlytest_keys_match_same_key/different_key/different_type/ignores_commenttest_strict_mode_rejects_unknown_key— connection rejected with no trusted keytest_strict_host_key_checking_propagation— config flows through client