Lune

USENIX Security2024顶会

Terrapin Attack: Breaking SSH Channel Integrity By Sequence Number Manipulation

Fabian Bäumer, Marcus Brinkmann, Jörg Schwenk

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Hop: A Modern Transport and Remote Access Protocol 引用了 Transcript Collision Attacks: Breaking Authentication in TLS, IKE and SSH
  • Hop: A Modern Transport and Remote Access Protocol 引用了 Finding SSH Strict Key Exchange Violations by State Learning
  • Hop: A Modern Transport and Remote Access Protocol 引用了 Catch-22: Uncovering Compromised Hosts using SSH Public Keys
  • SAPIC+: protocol verifiers of the world, unite! 引用了 SoK: Computer-Aided Cryptography
  • Crossing the Streams: SSH Plaintext Recovery via a Common Compression Context in Multiplexed Channels 引用了 A Surfeit of SSH Cipher Suites
  • Crossing the Streams: SSH Plaintext Recovery via a Common Compression Context in Multiplexed Channels 引用了 Transcript Collision Attacks: Breaking Authentication in TLS, IKE and SSH
  • Crossing the Streams: SSH Plaintext Recovery via a Common Compression Context in Multiplexed Channels 引用了 Finding SSH Strict Key Exchange Violations by State Learning
  • Finding SSH Strict Key Exchange Violations by State Learning 引用了 Transcript Collision Attacks: Breaking Authentication in TLS, IKE and SSH
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. Finding SSH Strict Key Exchange Violations by State LearningFabian Bäumer, Marcel Maehren, Marcus Brinkmann, Jörg SchwenkCCS 2025 · 1 次引用
  2. Hop: A Modern Transport and Remote Access ProtocolPaul Flammarion, George Hosono, Wilson Nguyen, Laura Bauman 等USENIX Security 2026
  3. Crossing the Streams: SSH Plaintext Recovery via a Common Compression Context in Multiplexed ChannelsFabian Bäumer, Marcus BrinkmannCCS 2026
  4. Catch-22: Uncovering Compromised Hosts using SSH Public KeysCristian Munteanu, Georgios Smaragdakis, Anja Feldmann, Tobias FiebigUSENIX Security 2025

它引用的 Paper4

  1. SoK: Computer-Aided CryptographyManuel Barbosa, Gilles Barthe, Karthik Bhargavan, Bruno Blanchet 等S&P 2021 · 169 次引用
  2. Transcript Collision Attacks: Breaking Authentication in TLS, IKE and SSHKarthikeyan Bhargavan, Gaëtan LeurentNDSS 2016 · 128 次引用
  3. A Surfeit of SSH Cipher SuitesMartin R. Albrecht, Jean Paul Degabriele, Torben Brandt Hansen, Kenneth G. PatersonCCS 2016 · 36 次引用
  4. SAPIC+: protocol verifiers of the world, unite!Vincent Cheval, Charlie Jacomme, Steve Kremer, Robert KünnemannUSENIX Security 2022

相关 Paper

  1. Post-Quantum Cryptographic Analysis of SSHBenjamin Bencina, Benjamin Dowling, Varun Maram, Keita XagawaS&P 2025
  2. Passive SSH Key Compromise via LatticesKeegan Ryan, Kaiwen He, George Arnold Sullivan, Nadia HeningerCCS 2023 · 8 次引用
  3. "Make Sure DSA Signing Exponentiations Really are Constant-Time"Cesar Pereida García, Billy Bob Brumley, Yuval YaromCCS 2016 · 93 次引用
  4. Downgrade Resilience in Key-Exchange ProtocolsKarthikeyan Bhargavan, Christina Brzuska, Cédric Fournet, Matthew Green 等S&P 2016 · 54 次引用
  5. Practical Privacy-Preserving Authentication for SSHLawrence Roy, Stanislav Lyakhov, Yeongjin Jang, Mike RosulekUSENIX Security 2022
黄昏的海面,两侧是细线勾勒的悬崖