[go: up one dir, main page]

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

openssh deprecates ssh-rsa key type: maybe update vagrant insecure key #11783

Closed
dustymabe opened this issue Jul 24, 2020 · 12 comments · Fixed by #12298
Closed

openssh deprecates ssh-rsa key type: maybe update vagrant insecure key #11783

dustymabe opened this issue Jul 24, 2020 · 12 comments · Fixed by #12298

Comments

@dustymabe
Copy link
Contributor

Vagrant version

vagrant-2.2.9

Host operating system

Fedora 31

Guest operating system

Fedora Rawhide (will become Fedora 33) with openssh-8.3p1-3.fc33.x86_64 and crypto-policies-20200702-1.gitc40cede.fc33.noarch.

Vagrantfile

Any vagrantfile

Expected behavior

vagrant up works. vagrant ssh works.

Actual behavior

Gets stuck at Waiting for SSH to become available.... Inside the box in the logs we see:

Jul 24 15:21:32 localhost.localdomain sshd[1853]: userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedKeyTypes [preauth]

Description

Upstream SSH has been claiming for a few releases now that:

It is now possible to perform chosen-prefix attacks against the
SHA-1 algorithm for less than USD$50K. For this reason, we will be
disabling the "ssh-rsa" public key signature algorithm by default in a
near-future release.

Distributions are picking up on this and deprecating ssh-rsa. Fedora did this recently and it will land in the next major Fedora release. We should consider updating the pubkey to something that uses a newer algorithm.

@briancain
Copy link
Member

Hey there @dustymabe - thanks for the heads up, that makes sense. insecure_private_key is however named that for a reason :) So I don't know how soon we'll get to this, but I'm happy to keep this issue open for now. Also, to avoid the warning, you can always replace the insecure key with one of your own so that you aren't using the default: https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html#config-ssh-insert_key

@dustymabe
Copy link
Contributor Author
dustymabe commented Jul 24, 2020

Hey there @dustymabe - thanks for the heads up, that makes sense. insecure_private_key is however named that for a reason :) So I don't know how soon we'll get to this, but I'm happy to keep this issue open for now.

Thanks!

Also, to avoid the warning, you can always replace the insecure key with one of your own so that you aren't using the default: https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html#config-ssh-insert_key

It's not a warning that can be ignored. It's an error. The vagrant up never completes and hangs at Waiting for SSH to become available... and thus would never be able to replace the insecure key because it can never get into the box to begin with.

I do the box builds for Fedora and publish them to https://app.vagrantup.com/fedora. Other distros are going to hit this soon, Fedora just happens to be one of the earliest to pick things up.

@briancain
Copy link
Member

Ohhh, I see! Well that makes sense. Thanks for letting us know then @dustymabe

@briancain briancain added the bug label Jul 24, 2020
@jshimkus-rh
Copy link

This may not be for everyone, but my team has found that incorporating update-crypto-policies --set LEGACY
in Fedora 33 vagrant box generation does successfully set the policies such that vagrant can communicate with the box during vagrant up.

@travier
Copy link
travier commented Oct 2, 2020

Fedora 33 is now in Beta. (Edit: Upstream OpenSSH is still planning on deprecating the RSA-SHA1 key type).

hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Oct 31, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Oct 31, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Nov 1, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Nov 1, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Nov 1, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Nov 1, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Nov 1, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Nov 1, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Nov 1, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
@hswong3i
Copy link
hswong3i commented Nov 2, 2020

This may not be for everyone, but my team has found that incorporating update-crypto-policies --set LEGACY
in Fedora 33 vagrant box generation does successfully set the policies such that vagrant can communicate with the box during vagrant up.

@jshimkus-rh I am now implementing update-crypto-policies --set LEGACY for lavabit/robox#173, but always get reinitialized to DEFAULT during first vagrant up. May you share some hints about your successful story?

@jshimkus-rh
Copy link
jshimkus-rh commented Nov 2, 2020 via email

@dustymabe
Copy link
Contributor Author

For those trying to figure out how to work around this, check out what I did in the official fedora vagrant box for now: https://pagure.io/fedora-kickstarts/pull-request/669#request_diff

hswong3i added a commit to alvistack/lavabit-robox that referenced this issue Nov 5, 2020
Upstream SSH has been claiming for a few releases now that:

    It is now possible to perform chosen-prefix attacks against the
    SHA-1 algorithm for less than USD$50K. For this reason, we will be
    disabling the "ssh-rsa" public key signature algorithm by default in a
    near-future release.

See hashicorp/vagrant#11783 (comment)
@timcoote
Copy link
timcoote commented Apr 8, 2021

For those trying to figure out how to work around this, check out what I did in the official fedora vagrant box for now: https://pagure.io/fedora-kickstarts/pull-request/669#request_diff

dunno whether it should have done - probably not - but this workaround didn't make it into the fedora 33 cloudbase amis (eg ami-0edca001b0a05f840)

@dustymabe
Copy link
Contributor Author

The Fedora cloud images uploaded to AWS aren't specific to vagrant so they weren't updated to workaround this problem.

@chrisroberts
Copy link
Member

Hi everyone,

I was confused on why this was still an issue with the net-ssh backports in place to support the rsa-sha2-256 (and 512 variant) signatures. There is no issue with RSA keys so long as they are SSH2 keys, not SSH1. From the OpenSSH release notes (https://www.openssh.com/txt/release-8.5):

Note that the deactivation of "ssh-rsa" signatures does not necessarily
require cessation of use for RSA keys. In the SSH protocol, keys may be
capable of signing using multiple algorithms. In particular, "ssh-rsa"
keys are capable of signing using "rsa-sha2-256" (RSA/SHA256),
"rsa-sha2-512" (RSA/SHA512) and "ssh-rsa" (RSA/SHA1). Only the last of
these is being turned off by default.

In fact, we can see this is actually the case by removing ssh-rsa from the PubkeyAcceptedKeyTypes (assuming a fedora 33 box with config update applied to allow ssh-rsa), reload the sshd and then run:

> vagrant provision

When a provision script is attempted to be run by Vagrant, we see that there's an error connecting. However, if we run:

> vagrant ssh

We can connect as expected. This means that as far as OpenSSH is concerned, the RSA keys we are attempting to use are in fact valid. The vagrant ssh command uses the OpenSSH ssh client under the hood but vagrant provision uses the SSH communicator plugin which is built on the net-ssh library. That meant that something has changed with how the OpenSSH client is doing authentication that the net-ssh library is not doing.

After digging through a bunch of code in the net-ssh library, the OpenSSH source, and some of the OpenSSL source I happened upon this commit:

openssh/openssh-portable@d1e578a

wherein the client has been updated to send the signature algorithm in the USERAUTH_REQUEST, not the key type. Applying some quick modifications to the net-ssh source for RSA public key authentication resulted in successful authentication and the end results are the modifications found in #12298. These changes will be included in the next release and will resolve this issue.

Cheers!

@ghost
Copy link
ghost commented May 14, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants