Rework pubkey_options struct#416
Merged
Merged
Conversation
Pubkey info is now included in the restriction struct. A temporary pubkey_options is filled then set in the global session after auth.
Owner
Author
|
This PR fixed a security issue
After the initial pubkey auth succeeds (with forced_command key), a subsequent failed pubkey attempt could clear the forced command option. That's only applicable with "-t" where it accepts the subsequent attempts. The commit here is a large rework (and IMO improves the code), but a simpler mitigation for the fix would be to not clear the options. Lines 271 to 274 in f5d4440 becomes /* Retain pubkey options if auth succeeded or pubkey partial success (multi-auth).
* In multi-auth mode, pubkey success clears AUTH_TYPE_PUBKEY from authtypes.
* If that flag is cleared, pubkey auth succeeded and options should persist. */
if (!ses.authstate.authdone
&& (ses.authstate.authtypes & AUTH_TYPE_PUBKEY)) {
svr_pubkey_options_cleanup();
}Note that I haven't tested that thoroughly. |
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.
Pubkey info is now included in the restriction struct. A temporary pubkey_options is filled then set in the global session after auth.