Multiple severe vulnerabilities have been discovered in the widely used Secure Shell (SSH) cryptographic network protocol, including the “Terrapin vulnerability” (CVE-2023-48795) [7]. This vulnerability, known as Terrapin [2], allows attackers to compromise the integrity of established SSH connections by manipulating the extension negotiation message.

Description

Terrapin is an exploit that enables attackers to manipulate sequence numbers during the handshake of SSH connections, resulting in the removal of messages without detection. This manipulation downgrades the connection’s security [3] [4] [5] [6], potentially leading to the use of less secure client authentication algorithms and the deactivation of countermeasures against keystroke timing attacks [3]. Terrapin is considered the “first ever practically exploitable prefix truncation attack” and affects various SSH client and server implementations [6], such as OpenSSH [4], Paramiko [4] [6], PuTTY [4] [6], KiTTY [6], WinSCP [6], libssh [6], libssh2 [6], AsyncSSH [6], FileZilla [6], and Dropbear [6].

To mitigate CVE-2023-48795, it is recommended to disable certain algorithms at the client level and implement strict key exchange [1]. Endpoints should terminate the connection if any unnecessary or unexpected message is received during key exchange [1]. Additionally, resetting the Message Authentication Code counter at the conclusion of each key exchange prevents previously inserted messages from making persistent changes to the sequence number [1]. These measures should be sufficient to thwart the Terrapin Attack [1].

Conclusion

Patches have been released to mitigate the risks associated with Terrapin [6], but it is crucial for organizations to ensure they have patched their servers and identified vulnerable occurrences across their entire infrastructure [6]. Users are strongly advised to update to OpenSSH 9.6 immediately [7]. The CVSS score for this vulnerability is 5.9 [2] [5]. More information about the Terrapin attack can be found at terrapin-attack.com. It is important to take these vulnerabilities seriously and implement the recommended mitigations to protect against potential attacks.

References

[1] https://github.com/phpseclib/phpseclib/issues/1972
[2] https://cyber.vumetric.com/security-news/2024/01/01/new-terrapin-flaw-could-let-attackers-downgrade-ssh-protocol-security/
[3] https://www.redpacketsecurity.com/new-terrapin-flaw-could-let-attackers-downgrade-ssh-protocol-security/
[4] https://thehackernews.com/2024/01/new-terrapin-flaw-could-let-attackers.html
[5] https://news.backbox.org/2024/01/01/new-terrapin-flaw-could-let-attackers-downgrade-ssh-protocol-security/
[6] https://vulners.com/thn/THN:02FC7E1F70336B3419C2D63FD0206998
[7] https://linuxsecurity.com/newsletters/linux-advisory-watch-archives/linux-advisory-watch-december-29-2023