Prefix Truncation Attack against ChaCha20-Poly1305 and Encrypt-then-MAC aka Terrapin
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.
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.
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).
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.
This issue can be reached over the network, attack complexity is high, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity high, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
CVE-2023-48795 is classified as CWE-354: Improper Validation of Integrity Check Value. A checksum or integrity value is not verified properly, so tampered data passes as intact.
CVE-2023-48795 is recorded against 72 packages.
Published on 18 December 2023 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from NVD.
packetstormsecurity.com
seclists.org
www.openwall.com
www.openwall.com
www.openwall.com
www.openwall.com
www.openwall.com
access.redhat.com
arstechnica.com
bugs.gentoo.org
bugzilla.redhat.com
bugzilla.suse.com
crates.io
filezilla-project.org
forum.netgate.com
git.libssh.org
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
github.com
advanced-cluster-security has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-354: Improper Validation of Integrity Check Value) in other software:
Each distribution ships its own build and its own fixed version. Pick the one you run:
Details
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| advanced-cluster-security | — | — |
| asyncssh | — | 2.14.2 |
| ceph-storage | — | — |
| cert-manager-operator-for-red-hat-openshift | — | — |
| cluster-autoscaler-1.26 | — | 1.26.6-r1 |
| cluster-autoscaler-1.26-compat | — | 1.26.6-r1 |
| cluster-autoscaler-1.27 | — | 1.27.5-r1 |
| cluster-autoscaler-1.27-compat | — | 1.27.5-r1 |
| crushftp | — | 10.6.0 |
| crypto | — | 0.17.0 |
| cyclone-ssh | — | 2.3.4 |
| debian-linux | — | — |
| discovery | — | — |
| dropbear-ssh | — | 2022.83 |
| enterprise-linux | — | — |
| erlang\/otp | 26.0 | 26.2.1 |
| fedora | — | — |
| filezilla-client | — | 3.66.4 |
| freebsd | — | 12.4 |
| golang.org/x/crypto | — | — |
| jboss-enterprise-application-platform | — | — |
| jsch | — | 0.2.15 |
| keycloak | — | — |
| kitty | — | 0.76.1.13 |
| lanconfig | — | — |
| lcos | — | 3.66.4 |
| lcos-fx | — | — |
| lcos-lx | — | — |
| lcos-sx | — | — |
| libssh | — | 0.10.6 |
| libssh2 | — | 1.11.1 |
| macos | 14.0 | 14.4 |
| maverick-synergy-java-ssh-api | — | 3.1.0-snapshot |
| net-ssh | — | — |
| nova | — | 11.8 |
| openshift-api-for-data-protection | — | — |
| openshift-container-platform | — | — |
| openshift-data-foundation | — | — |
| openshift-dev-spaces | — | — |
| openshift-developer-tools-and-services | — | — |
| openshift-gitops | — | — |
| openshift-pipelines | — | — |
| openshift-serverless | — | — |
| openshift-virtualization | — | — |
| openssh | — | 9.6 |
| openstack-platform | — | — |
| paramiko | 2.5.0 | 3.4.0 |
| pfsense-ce | — | 2.7.2 |
| pfsense-plus | — | 23.09.1 |
| pkixssh | — | 14.4 |
| proftpd | — | 1.3.8b |
| putty | — | 0.80 |
| russh | — | — |
| securecrt | — | 9.4.3 |
| security | — | — |
| sftp-gateway-firmware | — | 3.4.6 |
| sftpgo | — | 2.5.6 |
| single-sign-on | — | — |
| ssh | 5.0 | 5.1.1 |
| ssh-client | — | 9.33 |
| ssh-server | — | 9.32 |
| ssh2 | — | — |
| sshd | — | 2.11.0 |
| sshj | — | 0.37.0 |
| sshlib | — | 2.2.22 |
| storage | — | — |
| tera-term | — | 5.1 |
| thrussh | — | 0.35.1 |
| tinyssh | — | 20230101 |
| transmit-5 | — | 5.10.4 |
| winscp | — | 6.2.2 |
| xshell-7 | — | build__0144 |
References
Similar Threats
Exploit Protection
CVE-2023-48795 carries CVSS 5.9 Medium rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2023-48795 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.