Terrapin 攻击:通过序列号操纵破坏 SSH 通道完整性
Terrapin Attack: Breaking SSH Channel Integrity By Sequence Number Manipulation
AI总结:
本文提出 Terrapin 攻击,利用未认证握手消息与密钥激活时序列号不重置实施 SSH 前缀截断,并给出协议修复方案。
摘要:
SSH 协议为网络服务提供安全访问,尤其是组织网络内部以及开放互联网上超过 1500 万台服务器的远程终端登录和文件传输。SSH 使用经过认证的密钥交换,在客户端与服务器之间建立安全通道,以保护双向发送消息的机密性和完整性。该安全通道可防止消息操纵、重放、插入、删除和重排序。在网络层面,SSH 在 TCP 之上使用 Binary Packet Protocol。本文证明,SSH Binary Packet Protocol 已不再是安全通道:对于三种广泛使用的加密模式,SSH 通道完整性(INT-PST、aINT-PTXT 和 INT-sfCTF)被破坏。这使得前缀截断攻击成为可能,即 SSH 通道开头的加密数据包可被删除,而客户端或服务器不会察觉。我们展示了该攻击的若干真实世界应用。结果表明,我们可以完全破坏 SSH 扩展协商(RFC 8308),使攻击者能够降级用于用户认证的公钥算法,或关闭 OpenSSH 9.5 中引入的针对击键时序攻击的新防护措施。此外,我们发现 AsyncSSH 中存在一个实现缺陷;该缺陷与前缀截断相结合,可使攻击者将受害者的登录重定向到由攻击者控制的 shell。我们还进行了一次全网范围扫描,发现 71.6% 的 SSH 服务器支持易受攻击的加密模式,而 63.2% 甚至将其列为首选。我们识别出导致这些攻击的两个根本原因:第一,SSH 握手支持未经认证的可选消息;第二,SSH 在激活加密密钥时不会重置消息序列号。基于这一分析,我们提出了对 SSH 的有效且向后兼容的修改,以缓解我们的攻击。
英文摘要:
The SSH protocol provides secure access to network services, particularly remote terminal login and file transfer within organizational networks and to over 15 million servers on the open internet. SSH uses an authenticated key exchange to establish a secure channel between a client and a server, which protects the confidentiality and integrity of messages sent in either direction. The secure channel prevents message manipulation, replay, insertion, deletion, and reordering. At the network level, SSH uses the Binary Packet Protocol over TCP. In this paper, we show that the SSH Binary Packet Protocol is no longer a secure channel: SSH channel integrity (INT-PST, aINT-PTXT, and INT-sfCTF) is broken for three widely used encryption modes. This allows prefix truncation attacks where encrypted packets at the beginning of the SSH channel can be deleted without the client or server noticing it. We demonstrate several real-world applications of this attack. We show that we can fully break SSH extension negotiation (RFC 8308), such that an attacker can downgrade the public key algorithms for user authentication or turn off a new countermeasure against keystroke timing attacks introduced in OpenSSH 9.5. Further, we identify an implementation flaw in AsyncSSH that, together with prefix truncation, allows an attacker to redirect the victim's login into a shell controlled by the attacker. We also performed an internet-wide scan and found that 71.6% of SSH servers support a vulnerable encryption mode, while 63.2% even list it as their preferred choice. We identify two root causes that enable these attacks: First, the SSH handshake supports optional messages that are not authenticated. Second, SSH does not reset message sequence numbers when activating encryption keys. Based on this analysis, we propose effective and backward-compatible changes to SSH that mitigate our attacks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。