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.
| Severity | Medium |
| CVSS 3.1 | 4.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.0 | 6.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 |
| CWE | CWE-327: Use of a Broken or Risky Cryptographic Algorithm |
| OWASP Top 10 | A04:2025 Cryptographic Failures |
| MITRE ATT&CK | T1557 Adversary-in-the-Middle, T1040 Network Sniffing |
| Category | Cryptographic 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-sha1anddiffie-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,CiphersandMACsdirectives insshd_configto explicit lists of strong algorithms, as in the example below. Check each name against the output ofssh -Q kex,ssh -Q cipherandssh -Q macon the server, add any post-quantum hybrid key exchange methods the installed release offers, and test the file withsshd -tbefore reloading, since an unknown name stops the service from starting. - Remove DSA host keys (the
HostKeyline for the DSA key), replace RSA host keys shorter than 2048 bits with Ed25519 or longer RSA keys, and removessh-rsa(RSA with SHA-1) fromHostKeyAlgorithmswhere the release still offers it, leavingrsa-sha2-512andrsa-sha2-256. - Where Diffie-Hellman group exchange stays enabled, remove short primes from the moduli file (
/etc/ssh/modulion 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.
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 trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.