-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/crypto/ssh: Client chokes after first key exchange against OpenSSH 7.4p1 server #51808
Labels
Milestone
Comments
peterverraedt
added a commit
to kuleuven/crypto
that referenced
this issue
Mar 21, 2022
In accordance to RFC8308, send ext-info-c only during the first key exchange. Some server implementations such as OpenSSH 7 will send an extInfoMsg message each time when ext-info-c is received. This results in a closed connection, as our client does not expect this message while handling the mux. See <https://bugzilla.mindrot.org/show_bug.cgi?id=2929> regarding the behaviour of OpenSSH if it sees ext-info-c in later key exchanges. Fixes: golang/go#51808 Signed-off-by: Peter Verraedt <[email protected]>
Change https://go.dev/cl/394134 mentions this issue: |
bradfitz
added a commit
to tailscale/tailscale
that referenced
this issue
Mar 23, 2022
(for golang/go#51808) Updates #3802 Change-Id: Ifbd483c0144b4c86da69143b23b2a06da7672c92 Signed-off-by: Brad Fitzpatrick <[email protected]>
bradfitz
added a commit
to tailscale/tailscale
that referenced
this issue
Mar 23, 2022
(for golang/go#51808) Updates #3802 Change-Id: Ifbd483c0144b4c86da69143b23b2a06da7672c92 Signed-off-by: Brad Fitzpatrick <[email protected]>
LewiGoddard
pushed a commit
to LewiGoddard/crypto
that referenced
this issue
Feb 16, 2023
In accordance to RFC8308, send ext-info-c only during the first key exchange. Some server implementations such as OpenSSH 7 will send an extInfoMsg message each time when ext-info-c is received. This results in a closed connection, as our client does not expect this message while handling the mux. See https://bugzilla.mindrot.org/show_bug.cgi?id=2929 regarding the behaviour of OpenSSH if it sees ext-info-c in later key exchanges. Fixes golang/go#51808 Change-Id: Id94f1ef73cec6147136246b0b6048b57db92660d GitHub-Last-Rev: fcfe5ed37306136219854031abc809e0dc9b3124 GitHub-Pull-Request: golang/crypto#208 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/394134 Reviewed-by: Filippo Valsorda <[email protected]> Run-TryBot: Filippo Valsorda <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Trust: Roland Shoemaker <[email protected]>
BiiChris
pushed a commit
to BiiChris/crypto
that referenced
this issue
Sep 15, 2023
In accordance to RFC8308, send ext-info-c only during the first key exchange. Some server implementations such as OpenSSH 7 will send an extInfoMsg message each time when ext-info-c is received. This results in a closed connection, as our client does not expect this message while handling the mux. See https://bugzilla.mindrot.org/show_bug.cgi?id=2929 regarding the behaviour of OpenSSH if it sees ext-info-c in later key exchanges. Fixes golang/go#51808 Change-Id: Id94f1ef73cec6147136246b0b6048b57db92660d GitHub-Last-Rev: fcfe5ed GitHub-Pull-Request: golang#208 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/394134 Reviewed-by: Filippo Valsorda <[email protected]> Run-TryBot: Filippo Valsorda <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Trust: Roland Shoemaker <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Tested with latest commits regarding RFC8308 support for client.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I'm running a ssh client (similar to https://github.com/helloyi/go-sshclient) against an OpenSSH 7.4p1 server, with client authentication using certificates, and running a command for a while (longer than 30 seconds) remotely, piping stdin/stdout through ssh.
What did you expect to see?
The command being completed successfully.
What did you see instead?
After RFC8308 was implemented client-side in the x/crypto/ssh package, the ssh client closes its connection suddenly after the first key reexchange, returning the error "remote command exited without exit status or exit signal".
The reason, at it seems, is that an OpenSSH 7.4p1 server receiving ext-info-c, sends msgExtInfo after every key exchange rather than only the first one, breaking RFC8308. The first one is correctly handled in https://github.com/golang/crypto/blob/master/ssh/client_auth.go#L33-L59, but the key reexchange happens when the mux is already set up and results in the connection being closed client-side.
The following patch works to circumvent the issue:
The issue is not present against OpenSSH 8.
The text was updated successfully, but these errors were encountered: