CVE-2023-48795 Prefix Truncation Attack against ChaCha20-Poly1305 and Encrypt-then-MAC aka Terrapin

Medium 5.9 Published Updated

Remote attackers can bypass SSH integrity checks to downgrade security features or disable encryption during the handshake phase.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-48795?

CVE-2023-48795 is a medium-severity vulnerability in Apple Macos, published on 18 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6 and other products, allows remote attackers to bypass integrity checks such that some packets are omitted (from the extension negotiation message), and a client and server may consequently end up with a connection for which some security features have been downgraded or disabled, aka a Terrapin attack. This occurs because the SSH Binary Packet Protocol (BPP), implemented by these extensions, mishandles the handshake phase and mishandles use of sequence numbers. For example, there is an effective attack against SSH's use of ChaCha20-Poly1305 (and CBC with Encrypt-then-MAC). The bypass occurs in [email protected] and (if CBC is used) the [email protected] MAC algorithms. This also affects Maverick Synergy Java SSH API before 3.1.0-SNAPSHOT, Dropbear through 2022.83, Ssh before 5.1.1 in Erlang/OTP, PuTTY before 0.80, AsyncSSH before 2.14.2, golang.org/x/crypto before 0.17.0, libssh before 0.10.6, libssh2 through 1.11.0, Thorn Tech SFTP Gateway before 3.4.6, Tera Term before 5.1, Paramiko before 3.4.0, jsch before 0.2.15, SFTPGo before 2.5.6, Netgate pfSense Plus through 23.09.1, Netgate pfSense CE through 2.7.2, HPN-SSH through 18.2.0, ProFTPD before 1.3.8b (and before 1.3.9rc2), ORYX CycloneSSH before 2.3.4, NetSarang XShell 7 before Build 0144, CrushFTP before 10.6.0, ConnectBot SSH library before 2.2.22, Apache MINA sshd through 2.11.0, sshj through 0.37.0, TinySSH through 20230101, trilead-ssh2 6401, LANCOM LCOS and LANconfig, FileZilla before 3.66.4, Nova before 11.8, PKIX-SSH before 14.4, SecureCRT before 9.4.3, Transmit5 before 5.10.4, Win32-OpenSSH before 9.5.0.0p1-Beta, WinSCP before 6.2.2, Bitvise SSH Server before 9.32, Bitvise SSH Client before 9.33, KiTTY through 0.76.1.13, the net-ssh gem 7.2.0 for Ruby, the mscdex ssh2 module before 1.15.0 for Node.js, the thrussh library before 0.35.1 for Rust, and the Russh crate before 0.40.2 for Rust.

Weakness: CWE-354

Which versions are affected by CVE-2023-48795?

10 open source packages ship an affected version, including golang.org/x/crypto, paramiko and russh. It affects 68 products.

PackageAffectedFixed in
golang.org/x/crypto GoAll versions0.0.0-20231218163308-9d2ee975ef9f
golang.org/x/crypto GoAll versions0.0.0-20231218163308-9d2ee975ef9f
golang.org/x/crypto GoAll versions0.17.0
golang.org/x/crypto GoFrom 0.1.00.17.0
golang.org/x/crypto GoFrom 0.1.00.17.0
paramiko PyPIFrom 2.5.03.4.0
4 more packages
paramiko PyPIFrom 2.5.03.4.0
paramiko PyPIFrom 2.5.03.4.0
russh crates.ioAll versions0.40.2
russh crates.ioAll versions0.40.2
Linux distribution packages (30)
libssh AlmaLinux:8All versions0.9.6-13.el8_9
libssh-config AlmaLinux:8All versions0.9.6-13.el8_9
libssh-devel AlmaLinux:8All versions0.9.6-13.el8_9
buildah AlmaLinux:9All versions1:1.31.4-1.el9_3
buildah-tests AlmaLinux:9All versions1:1.31.4-1.el9_3
libssh-debuginfo Red Hat:enterprise_linux:8::appstreamAll versions0:0.9.6-13.el8_9
libssh-debugsource Red Hat:enterprise_linux:8::appstreamAll versions0:0.9.6-13.el8_9
libssh-devel Red Hat:enterprise_linux:8::appstreamAll versions0:0.9.6-13.el8_9
libssh Red Hat:enterprise_linux:8::baseosAll versions0:0.9.6-13.el8_9
libssh-config Red Hat:enterprise_linux:8::baseosAll versions0:0.9.6-13.el8_9
libssh-debuginfo Red Hat:enterprise_linux:8::baseosAll versions0:0.9.6-13.el8_9
libssh-debugsource Red Hat:enterprise_linux:8::baseosAll versions0:0.9.6-13.el8_9
buildah Red Hat:enterprise_linux:9::appstreamAll versions1:1.31.4-1.el9_3
buildah-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions1:1.31.4-1.el9_3
buildah-debugsource Red Hat:enterprise_linux:9::appstreamAll versions1:1.31.4-1.el9_3
buildah-tests Red Hat:enterprise_linux:9::appstreamAll versions1:1.31.4-1.el9_3
buildah-tests-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions1:1.31.4-1.el9_3
libssh-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions0:0.10.4-12.el9_3
libssh-debugsource Red Hat:enterprise_linux:9::appstreamAll versions0:0.10.4-12.el9_3
libssh-devel Red Hat:enterprise_linux:9::appstreamAll versions0:0.10.4-12.el9_3
podman Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-debugsource Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-docker Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-gvproxy Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-gvproxy-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-plugins Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-plugins-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-remote Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3
podman-remote-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions2:4.6.1-8.el9_3

Products include 9bis Kitty, Apache Sshd, Apache Sshj, Apple Macos, Asyncssh Project Asyncssh, Bitvise Ssh Client and 62 more.

How do I fix CVE-2023-48795?

Upgrade golang.org/x/crypto to a fixed version for your release line: 0.0.0-20231218163308-9d2ee975ef9f or 0.17.0.

Is CVE-2023-48795 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-48795 exists.

Public exploit code: 1 Nuclei template and 5 proofs of concept on GitHub.

All Apple Macos vulnerabilities

Sources

Also known as ALPINE-CVE-2023-48795, ALSA-2024:0628, ALSA-2024:1150, AZL-32195, AZL-32196, AZL-32200 and 141 more.

Is CVE-2023-48795 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free