CVE-2023-48795Prefix Truncation Attack against ChaCha20-Poly1305 and Encrypt-then-MAC aka Terrapin
A medium-severity vulnerability reachable over the network, needing no privileges and no user interaction. EPSS estimates a 35.8% chance of exploitation in the next 30 days. A fixed version is named.
- Exploited in the wild
- Not in KEV
- EPSS
- 35.8%
- percentile 99%
- Fix
- Named by a source
- CVE published 18 Dec 2023
Reference
None of the "Needs attention" rules apply right now.
EPSS 35.8% (+36) · Network attack vector (+10) · No privileges required (+5) · No user interaction (+5)
Immediate actions
- russh (crates.io): upgrade to 0.40.2 or later on your release line.
- golang.org/x/crypto (Go): upgrade to 0.17.0 or later on your release line.
- paramiko (PyPI): upgrade to 3.4.0 or later on your release line.
- Patch: https://github.com/golang/crypto/commit/9d2ee975ef9fe627bf0a6f01c1f69e8ef1d4f05d
- Patch: https://go.dev/cl/550715
- Commit / pull request: https://github.com/libssh2/libssh2/pull/1291
- Commit / pull request: https://github.com/NixOS/nixpkgs/pull/275249
- Commit / pull request: https://github.com/mwiede/jsch/pull/461
- Commit / pull request: https://github.com/TeraTermProject/teraterm/commit/7279fbd6ef4d0c8bdd6a90af4ada2899d786eec0
Who should check
russh (crates.io) pkg:cargo/russh
- Affected< 0.40.2Fixed in0.40.2OSV (GHSA-45x7-px36-x8w8)
golang.org/x/crypto (Go) pkg:golang/golang.org/x/crypto
- Affected>= 0.1.0, < 0.17.0Fixed in0.17.0OSV (GHSA-45x7-px36-x8w8)
- Affected< 0.0.0-20231218163308-9d2ee975ef9fFixed in0.0.0-20231218163308-9d2ee975ef9fdisputedOSV (GHSA-45x7-px36-x8w8)
- Affected< 0.17.0Fixed in0.17.0OSV (GO-2023-2402)
paramiko (PyPI) pkg:pypi/paramiko
- Affected>= 2.5.0, < 3.4.0Fixed in3.4.0OSV (PYSEC-2026-1758)
Confirmed facts
- CVSS
- 5.9 MEDIUM (version 3.1)
- Score from
- PYSEC-2026-1758
- Attack vector
- network
- Attack complexity
- high
- Privileges required
- none
- User interaction
- none
- Weakness
- CWE-345, CWE-354
Unknowns
- We show one CVSS score. Other sources may score this CVE differently.
Advisory text
Quoted from the source advisory (untrusted)### Summary Terrapin is a prefix truncation attack targeting the SSH protocol. More precisely, Terrapin breaks the integrity of SSH's secure channel. By carefully adjusting the sequence numbers during the handshake, an attacker can remove an arbitrary amount of messages sent by the client or server at the beginning of the secure channel without the client or server noticing it. ### Mitigations To mitigate this protocol vulnerability, OpenSSH suggested a so-called "strict kex" which alters the SSH handshake to ensure a Man-in-the-Middle attacker cannot introduce unauthenticated messages as well as convey sequence number manipulation across handshakes. **Warning: To take effect, both the client and server must support this countermeasure.** As a stop-gap measure, peers may also (temporarily) disable the affected algorithms and use unaffected alternatives like AES-GCM instead until patches are available. ### Details The SSH specifications of ChaCha20-Poly1305 ([email protected]) and Encrypt-then-MAC (*[email protected] MACs) are vulnerable against an arbitrary prefix truncation attack (a.k.a. Terrapin attack). This allows for an extension negotiation downgrade by stripping the SSH_MSG_EXT_INFO sent after the first message after SSH_MSG_NEWKEYS, downgrading security, and disabling attack countermeasures in some versions of OpenSSH. When targeting Encrypt-then-MAC, this attack requires the use of a CBC cipher to be practically exploitable due to the internal workings of the cipher mode. Additionally, this novel attack technique can be used to exploit previously unexploitable implementation flaws in a Man-in-the-Middle scenario. The attack works by an attacker injecting an arbitrary number of SSH_MSG_IGNORE messages during the initial key exchange and consequently removing the same number of messages just after the initial key exchange has concluded. This is possible due to missing authentication of the excess SSH_MSG_IGNORE messages and the fact that the implicit sequence numbers used within the SSH protocol are only checked after the initial key exchange. In the case of ChaCha20-Poly1305, the attack is guaranteed to work on every connection as this cipher does not maintain an internal state other than the message's sequence number. In the case of Encrypt-Then-MAC, practical exploitation requires the use of a CBC cipher; while theoretical integrity is broken for all ciphers when using this mode, message processing will fail at the application layer for CTR and stream ciphers. For more details see [https://terrapin-attack.com](https://terrapin-attack.com). ### Impact This attack targets the specification of ChaCha20-Poly1305 ([email protected]) and Encrypt-then-MAC (*[email protected]), which are widely adopted by well-known SSH implementations and can be considered de-facto standard. These algorithms can be practically exploited; however, in the case of Encrypt-Then-MAC, we additionally require the use of a CBC cipher. As a consequence, this attack works against all well-behaving SSH implementations supporting either of those algorithms and can be used to downgrade (but not fully strip) connection security in case SSH extension negotiation (RFC8308) is supported. The attack may also enable attackers to exploit certain implementation flaws in a man-in-the-middle (MitM) scenario.
Update history
- 9 Mar 2026Exploitation more likely 48.0% → 57.9%
- 8 Mar 2026Exploitation more likely 48.0% → 57.9%
- 9 Feb 2026Exploitation more likely 48.0% → 57.9%
- 8 Feb 2026Exploitation more likely 48.0% → 57.9%
- 8 Jan 2026Exploitation more likely 47.9% → 57.8%
- 25 Nov 2025Exploitation more likely 50.5% → 61.7%
- 8 Sept 2025Exploitation more likely 57.2% → 69.8%
- 25 Aug 2025Exploitation more likely 63.4% → 74.6%
- 19 Aug 2025Exploitation more likely 61.3% → 77.3%
- 28 Jul 2025Exploitation more likely 64.8% → 76.0%
- 19 May 2025Exploitation more likely 46.8% → 81.7%
- 15 May 2025Exploitation more likely 60.0% → 77.2%
- 8 May 2025Exploitation more likely 43.8% → 60.0%
- 21 Apr 2025Exploitation more likely 58.6% → 70.8%
- 15 Apr 2025Exploitation more likely 56.4% → 74.3%
References
- otherhttps://github.com/warp-tech/russh/security/advisories/GHSA-45x7-px36-x8w8
- advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2023-48795
- otherhttps://github.com/ssh-mitm/ssh-mitm/issues/165
- otherhttps://github.com/hierynomus/sshj/issues/916
- otherhttps://github.com/janmojzis/tinyssh/issues/81
- otherhttps://github.com/cyd01/KiTTY/issues/520
- otherhttps://github.com/proftpd/proftpd/issues/456
- otherhttps://github.com/apache/mina-sshd/issues/445
- otherhttps://github.com/paramiko/paramiko/issues/2337#issuecomment-1887642773
- otherhttps://github.com/paramiko/paramiko/issues/2337
- otherhttps://github.com/PowerShell/Win32-OpenSSH/issues/2189
- otherhttps://github.com/mwiede/jsch/issues/457
- commit / pull requesthttps://github.com/libssh2/libssh2/pull/1291
- commit / pull requesthttps://github.com/NixOS/nixpkgs/pull/275249
- commit / pull requesthttps://github.com/mwiede/jsch/pull/461
- commit / pull requesthttps://github.com/TeraTermProject/teraterm/commit/7279fbd6ef4d0c8bdd6a90af4ada2899d786eec0
- commit / pull requesthttps://github.com/mscdex/ssh2/commit/97b223f8891b96d6fc054df5ab1d5a1a545da2a3
- commit / pull requesthttps://github.com/connectbot/sshlib/commit/5c8b534f6e97db7ac0e0e579331213aa25c173ab
- commit / pull requesthttps://github.com/jtesta/ssh-audit/commit/8e972c5e94b460379fe0c7d20209c16df81538a5
- commit / pull requesthttps://github.com/warp-tech/russh/commit/1aa340a7df1d5be1c0f4a9e247aade76dfdd2951
- patchhttps://github.com/golang/crypto/commit/9d2ee975ef9fe627bf0a6f01c1f69e8ef1d4f05d
- otherhttps://oryx-embedded.com/download/#changelog
- otherhttps://nova.app/releases/#v11.8
- otherhttps://news.ycombinator.com/item?id=38732005
- otherhttps://psirt.global.sonicwall.com/vuln-detail/SNWLID-2024-0002
- otherhttps://roumenpetrov.info/secsh/#news20231220
- otherhttps://security-tracker.debian.org/tracker/CVE-2023-48795
- otherhttps://security-tracker.debian.org/tracker/source-package/libssh2
- otherhttps://github.com/ronf/asyncssh/blob/develop/docs/changes.rst
- otherhttps://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KMZCVGUGJZZVDPCVDA7TEB22VUCNEXDD
Sources
- EPSS by FIRST.org, Free to use, attribution requested. Scores generated by Empirical Security.
- GHSA-45x7-px36-x8w8 (GitHub Advisory Database), CC BY 4.0.
- GO-2023-2402 (Go Vulnerability Database), CC BY 4.0.
- PYSEC-2026-1758 (PyPA Advisory Database), CC BY 4.0.
- OSV.dev, Per database.
This page is our own presentation: records are shortened, normalised and merged. Licences
Last checked: kev 36 min ago · osv 36 min ago · nvd 5 min ago · epss 36 min ago · JSON · ask via MCP: explain_vulnerability
Also known as GHSA-45x7-px36-x8w8, GO-2023-2402, PYSEC-2026-1758