Published on July 28, 2026

libssh2 Vulnerabilities Allow Malicious SSH Servers to Corrupt Client Memory


Severity

High

Detail

Security researchers have disclosed four high-severity vulnerabilities affecting libssh2, a widely used open-source C library that provides SSH2 protocol support for applications such as remote administration tools, SFTP clients, automated deployment platforms, backup solutions, and file transfer applications.

The vulnerabilities affect libssh2 version 1.11.1 and earlier and could allow a malicious SSH server to trigger memory corruption, application crashes, and potentially execute arbitrary code on affected client applications. Unlike traditional vulnerabilities targeting SSH servers, these issues affect applications acting as SSH or SFTP clients when connecting to a compromised or attacker-controlled server.

Successful exploitation requires a victim application to establish an SSH connection to a malicious server. Depending on the vulnerability exploited, attackers may trigger memory safety issues before or after authentication by sending specially crafted SSH protocol responses during connection establishment, SFTP operations, encryption negotiation, or public-key processing.

The vulnerabilities have been addressed through upstream security fixes, and organizations are advised to update affected libssh2 installations or rebuild applications using patched versions.

CVE IDSummaryCVSS Score
CVE-2026-66032A double-free vulnerability in the sftp_open() function allows a malicious SSH server to trigger memory corruption after an authenticated SFTP session, potentially leading to arbitrary code execution.8.8 (High)
CVE-2026-66033An integer underflow and out-of-bounds read vulnerability in the ssh2_cipher_crypt() function allows a malicious server to crash SSH clients during AES-GCM encryption negotiation before authentication.7.5 (High)
CVE-2026-66034A public-key parsing vulnerability allows malicious SSH servers to provide crafted length values, causing heap out-of-bounds reads and potential memory corruption.7.5 (High)
CVE-2026-66035A pre-authentication heap buffer overflow in the fullpacket() function allows malicious servers to send malformed packets and overwrite allocated memory during Encrypt-then-MAC negotiation.7.5 (High)

Affected Products

The vulnerabilities affect the following:

  • libssh2 version 1.11.1 and earlier
  • Applications and software products that statically bundle vulnerable libssh2 versions
  • SSH and SFTP client applications built using affected libssh2 libraries

Recommendation

Organizations should implement a layered security approach by applying the following measures to reduce the risk of exploitation from vulnerable libssh2 deployments and malicious SSH server activity:

  • Update libssh2 to a patched version that includes fixes for CVE-2026-66032, CVE-2026-66033, CVE-2026-66034, and CVE-2026-66035.
  • Rebuild applications that statically include libssh2 to ensure the vulnerable library code is replaced with the patched version.
  • Identify internally developed applications, automation tools, backup platforms, and file transfer solutions that use libssh2 and verify their dependency versions.
  • Avoid connecting SSH or SFTP clients to untrusted or unknown servers, especially in automated environments.

Source

https://cybersecuritynews.com/libssh2-vulnerabilities/

https://nvd.nist.gov/vuln/detail/CVE-2026-66032

https://nvd.nist.gov/vuln/detail/CVE-2026-66033

https://nvd.nist.gov/vuln/detail/CVE-2026-66034

https://nvd.nist.gov/vuln/detail/CVE-2026-66035