Weak cryptography

SSH negotiates its cipher, MAC, and key-exchange algorithms, and a server that still offers weak ones, legacy ciphers, MD5-based or truncated MACs, small Diffie-Hellman groups, lets a positioned attacker select or downgrade to a breakable session. These weaknesses enable decryption or tampering of traffic an attacker can capture or relay.

1분 분량2026년 10월 21일 업데이트florianamette기여자 1명
어시스턴트에게 묻기 (MCP)GitHub에서 편집

SSH begins each session by negotiating algorithms for key exchange, encryption, and message authentication from the lists both sides offer. If a server still advertises weak options, the negotiation (or a positioned attacker forcing it) can land on a breakable combination: legacy or broken ciphers, weak or truncated MACs, and small or flawed key-exchange groups. These do not matter against a passive observer of a strong session, but they enable decryption, tampering, or downgrade for an attacker who can capture or sit on the connection, and they are the enabling weakness behind some SSH machine-in-the-middle and traffic attacks.

bash
# enumerate offered algorithms and grade them
nmap -p22 --script ssh2-enum-algos <target>
ssh -Q cipher; ssh -Q mac; ssh -Q kex          # what your client supports (for comparison)
# connect forcing a weak algorithm to test acceptance
ssh -c aes128-cbc -o MACs=hmac-md5 user@<target>

Subtopics#

  • Legacy key exchange: identifying accepted weak or small groups without confusing client-selected negotiation with an active downgrade.
  • Weak ciphers: legacy and CBC-mode cipher weaknesses.
  • Weak MAC algorithms: broken or truncated integrity protection.

References#