Skip to content

Weird KexAlgorithms recommendations in hardening guide #324

@cjwatson

Description

@cjwatson

https://www.ssh-audit.com/hardening_guides.html has perplexing recommendations for KexAlgorithms. It includes a bunch of entries there, such as gss-curve25519-sha256-, which sshd_config(5) does not document as being valid for KexAlgorithms, but only for GSSAPIKeyAlgorithms. It may happen to work by luck, but it isn't guaranteed.

This is not only strange, but also harmful for multiple reasons:

  • As I described in https://lists.debian.org/debian-devel/2024/04/msg00044.html, I intend to split out GSS-API key exchange support from Debian's main OpenSSH packages in Debian 14 (forky), and that change will eventually trickle down to Ubuntu and other Debian derivatives. As a result of your guide being widely-distributed, I'm probably going to have to do some cumbersome hacking to avoid the situation where anyone who's followed your recommendations will have a configuration file that specifies key exchange algorithms that sshd no longer knows about at all. Or maybe I'll just leave it broken to force them to adapt, due to the next point ... I'm not sure yet.
  • OpenSSH is not likely to introduce new key exchange algorithms that are less secure than the existing ones. That means that specifying a positive list of permitted key exchange algorithms like this implicitly means opting out of any future improved algorithms that OpenSSH introduces. Since your intent appears to be to remove weak algorithms, you should instead use the method for removing items from the default set by beginning the list with a "-" character, which has been supported since OpenSSH 7.5; that would also be clearer by being more explicit about which algorithms you're removing. This applies to all of CASignatureAlgorithms, Ciphers, HostbasedAcceptedAlgorithms, KexAlgorithms, MACs, and PubkeyAcceptedAlgorithms (though unfortunately not to GSSAPIKexAlgorithms - I only just noticed that discrepancy).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions