CVE-2026-58051
MediumCVSS 6.5Exploitation Probability (EPSS)
Low risk20th percentile - higher than 20% of all known CVEs
Summary
In libssh2 up to version 1.11.1, when growing the publickey list with SSH2_REALLOC, new entries are not zero-initialized before parsing populates them. A parse failure reaching the cleanup path causes libssh2_publickey_list_free to operate on an uninitialized entry, potentially freeing an attacker-influenceable attrs pointer.
Risk Assessment
A malicious SSH server offering the publickey subsystem can exploit this vulnerability to trigger a use-after-free or double-free condition in the libssh2 client, potentially leading to remote code execution or application crash.
Recommendation
Immediately upgrade libssh2 to version 1.11.2 or later, which includes a fix that zero-initializes new entries before use. If an upgrade is not possible, restrict trust to SSH servers offering the publickey subsystem.
Other vulnerabilities in libssh2
See all- CVE-2026-66035High
Pre-authentication heap buffer overflow in libssh2 up to 1.11.1, allowing a malicious SSH server to corrupt client heap metadata by sending a packet with packet_length smaller than cipher block size during Encrypt-then-MAC negotiation.
- CVE-2026-66034High
Missing bounds check in libssh2 up to 1.11.1, allowing a malicious SSH server to trigger an arbitrary-length heap out-of-bounds read and free of an uninitialized pointer via the publickey subsystem.
- CVE-2026-66033High
Pre-authentication integer underflow in ssh2_cipher_crypt() in libssh2 up to 1.11.1, allowing a malicious SSH server to crash any connecting client by negotiating AES-GCM ciphers.
- CVE-2026-66032High
Double-free vulnerability in sftp_open() in libssh2 up to 1.11.1, allowing a malicious SSH server to corrupt the heap of any authenticated client opening an SFTP session.
- CVE-2026-58050High
A vulnerability in libssh2 up to version 1.11.1 allows an attacker-controlled SSH server to read a 32-bit attribute count from a publickey-subsystem response. This count is used for memory allocation without bounds checking, causing multiplication overflow on 32-bit platforms and an undersized buffer. A malicious server can then write past the allocation, leading to a heap buffer overflow in the connecting libssh2 client.
- CVE-2025-15661Medium
A vulnerability in libssh2 up to version 1.11.1 (fixed in commit 2dae302) causes an out-of-bounds heap read in the sftp_symlink() function in src/sftp.c. A malicious SSH server or man-in-the-middle attacker can send a crafted SSH_FXP_NAME response, leading to disclosure of heap memory contents or a crash.
- CVE-2026-55200High
libssh2 up to version 1.11.1 has an out-of-bounds write vulnerability in ssh2_transport_read() that fails to enforce upper bounds on the packet_length field. Remote attackers can send crafted SSH packets with excessively large packet_length values to corrupt heap memory and achieve remote code execution.
- CVE-2026-55199Medium
A pre-authentication denial of service vulnerability in libssh2 through version 1.11.1 (fixed in commit 1762685) allows a malicious SSH server to cause a client CPU exhaustion loop by sending a crafted extension count value (nr_extensions=0xFFFFFFFF) in the SSH_MSG_EXT_INFO handler. The client spins in a tight CPU loop for over 60 seconds because return values from _libssh2_get_string() are unchecked and the session timeout does not apply to CPU-bound loops.
- CVE-2026-25260High
Memory corruption vulnerability when accessing shared buffers without validation of concurrent user-mode input modifications.
- CVE-2026-7598High
A security vulnerability has been found in libssh2 up to version 1.11.1 in the userauth_password function of src/userauth.c. Manipulation of the username_len/password_len arguments leads to an integer overflow. The attack can be launched remotely.
Original NVD description (English source)
libssh2 through 1.11.1 grows its publickey list with SSH2_REALLOC but does not zero-initialize new entries before parsing populates them, so a parse failure reaching the cleanup path leaves libssh2_publickey_list_free operating on an uninitialized entry. A malicious SSH server offering the publickey subsystem can use a malformed response to make cleanup free an uninitialized, attacker-influenceable attrs pointer in a connecting libssh2 client.

