Security researchers from Ruhr-Universität Bochum have identified a vulnerability in the SSH (Secure Shell) cryptographic network protocol, labeled CVE-2023-48795, known as the Terrapin attack. This vulnerability allows an attacker to downgrade the security of an SSH connection by manipulating the sequence numbers during the handshake, potentially enabling the use of less secure client authentication algorithms and exploiting vulnerabilities in SSH implementations.
The attack could lead to a compromise of the encrypted session, enabling strong phishing attacks and providing the attacker with Man-in-the-Middle (MitM) capabilities. To execute a Terrapin attack, the attacker must have the ability to intercept and modify the data sent from the client or server to the remote peer, making it more feasible to be performed on a local network. Additionally, the attack requires the use of a vulnerable encryption mode. According to the researchers, their scan indicated that at least 77% of SSH servers on the internet support at least one mode that can be exploited in practice.
The vulnerability has implications for the overall security of SSH connections and emphasizes the importance of ensuring that both clients and servers are updated to be secure against the Terrapin attack. The researchers have notified nearly 30 providers of various SSH implementations and shared their findings to facilitate the development of fixes before publication. Several vendors and maintainers, including AsyncSSH, LibSSH, OpenSSH, PuTTY, SUSE, and others, have released patches to address the vulnerability.
The implementation of an optional strict key exchange has been introduced as a countermeasure against Terrapin attacks, introducing sequence number resets and preventing an attacker from injecting packets during the initial, unencrypted handshake. While vendors are actively releasing fixes, the researchers highlight the necessity of widespread updates for both clients and servers to ensure protection against Terrapin attacks. Administrators can use the Terrapin Vulnerability Scanner to assess whether an SSH client or server is vulnerable.
The scanner checks if vulnerable encryption modes are offered and whether the strict key exchange countermeasure is supported, providing a tool for administrators to evaluate their systems’ susceptibility to Terrapin attacks without executing the actual attack.
Reference