Re: OpenSSH 8.7p1 update for the base system

From: Ed Maste <emaste_at_freebsd.org>
Date: Wed, 08 Sep 2021 17:52:48 UTC
On Sat, 4 Sept 2021 at 11:59, Ed Maste <emaste@freebsd.org> wrote:
>
> I'm preparing to update OpenSSH in the FreeBSD base system to 8.7p1,
> and am sharing an initial patch for testing.

This is now in the tree (commit 19261079b743) - thanks to all who
reviewed / tested (on and off list).

One thing I forgot to include in the commit message - OpenSSH upstream
removed the DSA host key path from the default list some time ago. We
kept it slightly longer, but with this update it has been removed.
There are still a few local changes and bugfixes that need to be sent
upstream, and I hope to do so before OpenSSH 8.8 is released. Also
OpenSSH now has support for FIDO/U2F but not yet available in the base
system.

Finally, this note from upstream's release notes is important:
(https://www.openssh.com/releasenotes.html)

Imminent deprecation notice
===========================

OpenSSH will disable the ssh-rsa signature scheme by default in the
next release.

In the SSH protocol, the "ssh-rsa" signature scheme uses the SHA-1
hash algorithm in conjunction with the RSA public key algorithm. It is
now possible[1] to perform chosen-prefix attacks against the
SHA-1 algorithm for less than USD$50K.

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.

This algorithm is unfortunately still used widely despite the
existence of better alternatives, being the only remaining public key
signature algorithm specified by the original SSH RFCs that is still
enabled by default.

The better alternatives include:

 * The RFC8332 RSA SHA-2 signature algorithms rsa-sha2-256/512. These
   algorithms have the advantage of using the same key type as
   "ssh-rsa" but use the safe SHA-2 hash algorithms. These have been
   supported since OpenSSH 7.2 and are already used by default if the
   client and server support them.

 * The RFC8709 ssh-ed25519 signature algorithm. It has been supported
   in OpenSSH since release 6.5.

 * The RFC5656 ECDSA algorithms: ecdsa-sha2-nistp256/384/521. These
   have been supported by OpenSSH since release 5.7.

To check whether a server is using the weak ssh-rsa public key
algorithm, for host authentication, try to connect to it after
removing the ssh-rsa algorithm from ssh(1)'s allowed list:

    ssh -oHostKeyAlgorithms=-ssh-rsa user@host

If the host key verification fails and no other supported host key
types are available, the server software on that host should be
upgraded.

OpenSSH recently enabled the UpdateHostKeys option by default to
assist the client by automatically migrating to better algorithms.

[1] "SHA-1 is a Shambles: First Chosen-Prefix Collision on SHA-1 and
Application to the PGP Web of Trust" Leurent, G and Peyrin, T (2020)
https://eprint.iacr.org/2020/014.pdf