Skip to content
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: Cannot connect to unencrypted server #51860

Open
jfullerton44 opened this issue Mar 22, 2022 · 1 comment
Open

x/crypto/ssh: Cannot connect to unencrypted server #51860

jfullerton44 opened this issue Mar 22, 2022 · 1 comment
Labels
NeedsInvestigation
Milestone

Comments

@jfullerton44
Copy link

@jfullerton44 jfullerton44 commented Mar 22, 2022

What version of Go are you using (go version)?

go version go1.18 darwin/arm64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="arm64"
GOHOSTARCH="arm64"
GOHOSTOS="darwin"

What did you do?

Tried to connect to a server that has "none" used for KeyExchanges, Ciphers, and HostKeyAlgorithms. I set all three of these values in ClientConfig but the connection threw an error as the "none" value is currently not allowed for ciphers.

clientConfig := ssh.ClientConfig{
		User:    "user",
		Timeout: 10 * time.Second,
		HostKeyCallback: ssh.InsecureIgnoreHostKey(),
		Config: ssh.Config{
			KeyExchanges: []string{"none"},
			Ciphers:      []string{"none"},
		},
		HostKeyAlgorithms: []string{"none"},
	}

	sshClientConn, chans, reqs, err := ssh.NewClientConn(s.socket, "", &clientConfig)

What did you expect to see?

The client connects to the server without using encryption.

What did you see instead?

Using the above config produces the error

failed to create ssh session: error creating ssh client connection: ssh: handshake failed: ssh: no common algorithm for client to server cipher; client offered: [], server offered: [none]

The none value is accepted for KeyExchanges and HostKeyAlgorithms but for ciphers the none value is not being allowed which does not allow for the ssh client to connect without encryption.

@gopherbot gopherbot added this to the Unreleased milestone Mar 22, 2022
@seankhliao seankhliao added the NeedsInvestigation label Mar 22, 2022
@seankhliao
Copy link
Member

@seankhliao seankhliao commented Mar 22, 2022

cc @golang/security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

3 participants