CWE
345 354 362 119 20
Advisory Published
CVE Published
Advisory Published
Advisory Published
Advisory Published
Updated

CVE-2023-48795: Impact of Terrapin SSH Attack

First published: Tue Dec 12 2023(Updated: )

### 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 (chacha20-poly1305@openssh.com) and Encrypt-then-MAC (*-etm@openssh.com 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 (chacha20-poly1305@openssh.com) and Encrypt-then-MAC (*-etm@openssh.com), 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.

Credit: CVE-2023-48795 CVE-2023-51384 CVE-2023-51385 CVE-2024-23225 koocola an anonymous researcher ali yabuz Kirin @Pwnrin Meysam Firouzi @R00tkitsmm Trend Micro Zero Day Initiative @08Tc3wBB JamfCVE-2024-23283 Mickey Jin @patch1t Pedro Tôrres @t0rr3sp3dr0 Bohdan Stasiuk @Bohdan_Stasiuk Harsh Tyagi Wojciech Regula SecuRingCVE-2024-23296 Lyra Rebane (rebane2001) Matej Rabzelj CVE-2024-23238 Yiğit Can YILMAZ @yilmazcanyigit luckyu @uuulucky K宝 Fudan UniversityLFY @secsys Fudan UniversityLewis Hardy Bistrit Dahal CVE-2024-23241 CVE-2024-23242 Joshua Jewett @JoshJewett33 Matthew Loewen Deutsche Telekom Security GmbH sponsored by Bundesamt für Sicherheit in der Informationstechnik anbu1024 SecANTPwn2car James Lee @Windowsrcer Johan Carlsson (joaxcar) Georg Felber Marco Squarcina Junsung Lee Trend Micro Zero Day InitiativeZhenjiang Zhao pangu teamQianxin CrowdStrike Counter Adversary Operations CrowdStrike Counter Adversary OperationsAmir Bazine CrowdStrike Counter Adversary OperationsKarsten König CrowdStrike Counter Adversary OperationsDohyun Lee @l33d0hyun Lyutoon Mr.R Murray Mike CVE-2024-23235 Xinru Chi Pangu Labm4yfly with TianGong Team Legendsec at Qi'anxin GroupGuilherme Rambo Best Buddy AppsCsaba Fitzl @theevilbit OffSecCVE-2024-23205 CVE-2022-48554 Marc Newlin SkySafeBrian McNulty Stephan Casas CVE-2024-23291 cve@mitre.org

Affected SoftwareAffected VersionHow to fix
pip/paramiko>=2.5.0<3.4.0
3.4.0
go/golang.org/x/crypto<0.17.0
0.17.0
rust/russh<0.40.2
0.40.2
Apple macOS<14.4
14.4
redhat/PuTTY<0.80
0.80
redhat/AsyncSSH<2.14.1
2.14.1
redhat/libssh<0.9.8
0.9.8
redhat/libssh<0.10.6
0.10.6
redhat/golang.org/x/crypto/ssh<0.17.0
0.17.0
Palo Alto PAN-OS=9.0=9.1<10.1.15=10.1<10.2.11=10.2<11.0.6=11.0<11.1.3=11.1
10.1.15
10.2.11
11.0.6
11.1.3
Palo Alto Networks Prisma SD-WAN ION<5.6.19=5.6<6.1.8=6.1=6.2<6.3.2=6.3
5.6.19
6.1.8
6.3.2
debian/dropbear
2020.81-3+deb11u2
2022.83-1+deb12u2
2024.86-2
debian/erlang<=1:23.2.6+dfsg-1+deb11u1<=1:25.2.3+dfsg-1
1:25.3.2.12+dfsg-3
1:27.2.2+dfsg-1
debian/filezilla
3.52.2-3+deb11u1
3.63.0-1+deb12u3
3.68.1-1
debian/golang-go.crypto<=1:0.0~git20201221.eec23a3-1<=1:0.4.0-1
1:0.25.0-1
debian/jsch
0.1.55-1
0.2.19-1
debian/libssh
0.9.8-0+deb11u1
0.10.6-0+deb12u1
0.11.1-1
debian/libssh2
1.9.0-2+deb11u1
1.10.0-3
1.11.1-1
debian/openssh
1:8.4p1-5+deb11u3
1:8.4p1-5+deb11u4
1:9.2p1-2+deb12u4
1:9.2p1-2+deb12u5
1:9.9p1-3
1:9.9p2-1
debian/paramiko<=2.7.2-1<=2.12.0-2
3.5.0-1
3.5.1-2
debian/php-phpseclib
2.0.30-2+deb11u2
2.0.30-2+deb11u1
2.0.42-1+deb12u2
2.0.42-1+deb12u1
2.0.48-3
debian/php-phpseclib3
3.0.19-1+deb12u3
3.0.19-1+deb12u2
3.0.43-2
debian/phpseclib
1.0.19-3+deb11u2
1.0.19-3+deb11u1
1.0.20-1+deb12u2
1.0.20-1+deb12u1
1.0.23-6
debian/proftpd-dfsg<=1.3.7a+dfsg-12+deb11u2
1.3.7a+dfsg-12+deb11u3
1.3.8+dfsg-4+deb12u4
1.3.8.c+dfsg-1
debian/proftpd-mod-proxy<=0.7-1
0.9.2-1+deb12u1
0.9.4-1
debian/putty
0.74-1+deb11u2
0.74-1+deb11u1
0.78-2+deb12u2
0.78-2+deb12u1
0.83-2
debian/python-asyncssh<=2.5.0-0.1
2.5.0-0.1+deb11u1
2.10.1-2+deb12u2
2.10.1-2+deb12u1
2.19.0-1
debian/tinyssh<=20190101-1+deb11u1<=20230101-1
20250201-1
debian/trilead-ssh2<=6401+svn158-1.1<=6401+svn158-2
OpenSSH<9.6
PuTTY<0.80
FileZilla Client<3.66.4
Microsoft PowerShell<=11.1.0
All of
Apple iOS and macOS
Panic Transmit 5<5.10.4
All of
Apple iOS and macOS
Panic Nova<11.8
pkixssh<14.4
WinSCP<6.2.2
Bitvise SSH Client<9.33
Bitvise SSH Server<9.32
Lancom Systems LCOS<=3.66.4
Lancom Systems LCOS
LCOS lx
Lancom Systems LCOS SX=4.20
Lancom Systems LCOS SX=5.20
LANconfig
SecureCRT<9.4.3
Ubuntu<0.10.6
Net::SSH=7.2.0
ssh2 project ssh2 node.js<=1.11.0
ProFTPD<=1.3.8b
FreeBSD FreeBSD<=12.4
thrussh<0.35.1
Tera Term<=5.1
Oryx-Embedded Cyclone SSH<2.3.4
CrushFTP<=10.6.0
NetSarang XShell 7<build__0144
Paramiko Paramiko<3.4.0
redhat openshift container platform=4.0
Red Hat OpenStack Platform=16.1
Red Hat OpenStack Platform=16.2
Red Hat OpenStack Platform=17.1
redhat Ceph storage=6.0
Red Hat Enterprise Linux=8.0
Red Hat Enterprise Linux=9.0
Red Hat OpenShift Serverless
Red Hat OpenShift GitOps
Red Hat OpenShift Pipelines
Red Hat OpenShift Developer Tools and Services
Red Hat OpenShift Data Foundation=4.0
Red Hat OpenShift API for Data Protection
Red Hat OpenShift Virtualization=4
Red Hat Storage=3.0
Red Hat Discovery
Red Hat OpenShift Dev Spaces
Red Hat Cert Manager Operator for Red Hat OpenShift
Red Hat Keycloak
redhat jboss enterprise application platform=7.0
redhat single sign-on=7.0
Red Hat Advanced Cluster Security=3.0
Red Hat Advanced Cluster Security=4.0
golang.org/x/crypto<0.17.0
russh project russh Rust<0.40.2
SFTPGo<2.5.6
Erlang/OTP<26.2.1
JCraft JSch<0.2.15
libssh2<1.11.1
AsyncSSH<2.14.2
Dropbear SSH<2022.83
jadaptive Maverick Synergy Java SSH api<3.1.0-snapshot
SSH (Secure Shell)<5.11
thorntech SFTP Gateway firmware<3.4.6
Netgate pfSense Plus<=23.09.1
pfSense<=2.7.2
CrushFTP<10.6.0
ConnectBot sshlib<2.2.22
Apache SSHD<=2.11.0
sshj<=0.37.0
TinySSH<=20230101
Trilead SSH2=6401
KiTTY<=0.76.1.13
All of
Gentoo Security
Debian GNU/Linux
Fedoraproject Fedora=38
Fedoraproject Fedora=39
Debian GNU/Linux=10.0
Apple iOS and macOS>=14.0<14.4
All of
Gentoo Security
Debian
Debian=10.0

Remedy

If using the SSH client provided with PAN-OS to connect from the firewall to an external SSH server, ensure that the SSH server does not support the CHACHA20-POLY1305 algorithm or any Encrypt-then-MAC algorithms.

Remedy

PAN-OS customers can resolve this issue by configuring the in-use SSH profile to contain at least one cipher and at least one MAC algorithm, which removes support for CHACHA20-POLY1305 and all Encrypt-then-MAC algorithms available (ciphers with -etm in the name) in PAN-OS software. Guidance on how to configure strong ciphers and algorithms can be found on the following pages: - https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u0000004OOQCA2 - https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-cli-quick-start/get-started-with-the-cli/refresh-ssh-keys-mgt-port-connection To validate that the affected ciphers and algorithms are no longer enabled, please see the guidance at: https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000kF2eCAE This issue is completely resolved by following the recommended best practices for deploying PAN-OS (https://docs.paloaltonetworks.com/best-practices/10-1/administrative-access-best-practices/administrative-access-best-practices/deploy-administrative-access-best-practices). No additional PAN-OS fixes are planned in maintenance releases at this time. The PAN-OS SSH client is fixed in PAN-OS 10.2.11, PAN-OS 11.0.6, PAN-OS 11.1.3, and all later PAN-OS versions. The PAN-OS SSH client will be fixed in PAN-OS 10.1.15. This issue is fixed in Prisma SD-WAN ION 5.6.19, Prisma SD-WAN ION 6.1.8, Prisma SD-WAN ION 6.3.2, and all later Prisma SD-WAN ION versions. If you are using the Prisma SD-WAN ION 6.2 series, evaluate moving to another Prisma SD-WAN ION series number based on the guidance here: https://live.paloaltonetworks.com/t5/customer-resources/prisma-sd-wan-ion-software-release-guidelines/ta-p/578685.

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Reference Links

Parent vulnerabilities

(Appears in the following advisories)

Frequently Asked Questions

  • What is the severity of CVE-2023-48795?

    CVE-2023-48795 has been classified as a high severity vulnerability affecting the integrity of the SSH protocol.

  • How do I fix CVE-2023-48795?

    To fix CVE-2023-48795, upgrade to the recommended versions of affected software such as Paramiko 3.4.0 or higher, and ensure all SSH implementations are updated accordingly.

  • What types of software are affected by CVE-2023-48795?

    CVE-2023-48795 impacts various SSH implementations including Paramiko, OpenSSH, PuTTY, and several other cryptographic libraries.

  • Can CVE-2023-48795 be exploited remotely?

    Yes, CVE-2023-48795 can be exploited remotely by attackers during the SSH handshake process.

  • What is the nature of the attack described in CVE-2023-48795?

    CVE-2023-48795 refers to a prefix truncation attack, which compromises the integrity of the SSH secure channel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203