Repository navigation
Transport.connect(): fix host key test - #1066
Open
SebastianDeiss wants to merge 1 commit into
Open
SebastianDeiss wants to merge 1 commit into
SebastianDeiss wants to merge 1 commit into
Conversation
Skip the host key check only, if the transport actually used gssapi-keyex.
ploxiln
reviewed
Sep 18, 2017
| # If GSS-API Key Exchange was performed, we are not required to check | ||
| # the host key. | ||
| if (hostkey is not None) and not gss_kex: | ||
| if (hostkey is not None) and not self.gss_kex_used: |
Contributor
There was a problem hiding this comment.
is this "too early"? might gss_kex_used be set just below via self.auth_gssapi_keyex(username)?
Author
There was a problem hiding this comment.
gss_kex_used is not set in transport.py. It is set in kex_gss.py. The host key check is performed during key exchange (or not, if GSS-API is used) and therefore must be done in Transport.connect().
In Transport.auth_gssapi_keyex(username) the user is authenticated if a successful GSS-API key exchange was performed. That's a different layer in the SSH protocol.
Contributor
There was a problem hiding this comment.
I see, makes sense (gss is setup via start_client() -> start() -> run() -> _send_kex_init() / _expect_packet()) - I'm not familiar with gss, just clarifying :)
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.
Skip the host key check in
Transport.connect()only, if the transport actually used gssapi-keyex.Before this change, a MITM attack on the paramiko ssh client with
gss_kex=Truewas possible by having a server that does not support gssapi-keyex and gives any or no host key.This pull fixes the same issue as #1059, but for
Transport.connect().