SSH Weak Cryptographic Algorithms Supported

The SSH server offers obsolete key exchange, cipher, MAC or host key algorithms, which older clients may negotiate instead of the strong ones the server also supports.

SeverityMedium
CVSS 3.14.8 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N Open in the calculator
CVSS 4.06.3 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-327: Use of a Broken or Risky Cryptographic Algorithm
OWASP Top 10A04:2025 Cryptographic Failures
MITRE ATT&CKT1557 Adversary-in-the-Middle, T1040 Network Sniffing
CategoryCryptographic Failures

Description

The SSH server offers algorithms that are no longer considered strong enough in the negotiation that starts every connection. SSH negotiates four kinds of algorithm separately (key exchange, host key signature, cipher and message authentication code, or MAC), and the server lists every algorithm it is willing to use for each. Weak entries commonly found include:

  • key exchange methods that use the 1024-bit Diffie-Hellman group or the SHA-1 hash, such as diffie-hellman-group1-sha1 and diffie-hellman-group-exchange-sha1;
  • ciphers in CBC mode, RC4 (arcfour), Triple DES, Blowfish and CAST;
  • MACs based on MD5, truncated 96-bit MACs and 64-bit UMAC;
  • DSA host keys (ssh-dss), RSA signatures using SHA-1 (ssh-rsa) and RSA host keys shorter than 2048 bits.

Weak algorithms are only used when both the client and the server choose them, and the negotiation itself is protected by the key exchange, so an attacker cannot simply force a modern client to use them. The risk falls on connections from older clients, scripts and devices that prefer or only support the weak algorithms. An attacker able to intercept those connections, and with considerable resources, might then decrypt or alter their traffic, or impersonate the server where its host key or signature algorithm can be broken, although practical attacks against most of these algorithms in SSH remain difficult.

The issue therefore mainly removes safety margin, but it also shows that the SSH software or its configuration has not kept pace with current guidance. Older SSH servers on network devices, appliances and embedded systems are the most common source, followed by servers whose configuration re-enables legacy algorithms for compatibility with old clients.

The algorithms offered can be listed without credentials, with tools such as ssh-audit or the Nmap ssh2-enum-algos script. Scanners usually report each kind as a separate finding, for example CBC mode ciphers, weak MAC algorithms or weak key exchange algorithms enabled.

Remediation

Restrict the server to strong algorithms only:

  • On OpenSSH, set the KexAlgorithms, Ciphers and MACs directives in sshd_config to explicit lists of strong algorithms, as in the example below. Check each name against the output of ssh -Q kex, ssh -Q cipher and ssh -Q mac on the server, add any post-quantum hybrid key exchange methods the installed release offers, and test the file with sshd -t before reloading, since an unknown name stops the service from starting.
  • Remove DSA host keys (the HostKey line for the DSA key), replace RSA host keys shorter than 2048 bits with Ed25519 or longer RSA keys, and remove ssh-rsa (RSA with SHA-1) from HostKeyAlgorithms where the release still offers it, leaving rsa-sha2-512 and rsa-sha2-256.
  • Where Diffie-Hellman group exchange stays enabled, remove short primes from the moduli file (/etc/ssh/moduli on most Linux distributions); 3072 bits is a common minimum.
  • On network devices and appliances, restrict the same lists with the vendor's SSH algorithm settings, or upgrade the firmware where the weak algorithms cannot be disabled.
  • Upgrade old clients, scripts and devices that need the weak algorithms, rather than keeping them enabled on the server.
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256 Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com

Keep chacha20-poly1305@openssh.com only on a release that supports strict key exchange, which protects it against the Terrapin attack. Until the change is made, limit SSH access to management networks. Confirm the fix with sshd -T, which prints the settings in effect, and by repeating the algorithm enumeration from the network.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding