libssh vulnerabilities
26 known CVE vulnerabilities in libssh, translated and rated.
- CVE-2015-3146High
Versions of libssh before 0.6.5 have a state validation issue in the handling of SSH_MSG_NEWKEYS and SSH_MSG_KEXDH_REPLY packets, which can lead to system crashes.
- CVE-2026-59851High
Vulnerability in the libssh library on servers with GSSAPIKeyExchange enabled. The gssapi-keyex path does not verify whether the authenticated Kerberos principal is authorized for the requested local user, allowing authenticated clients to log in as arbitrary users.
- CVE-2026-59850Medium
In the libssh library, if data packets are processed after a channel is closed, channel data callbacks can be invoked after the associated data has already been freed, leading to crashes or possible use-after-free conditions.
- CVE-2026-59849Low
A logic error in libssh's automatic certificate-based public key authentication causes libssh clients to loop indefinitely when configured certificates are missing or repeatedly rejected by a server, leading to denial of service.
- CVE-2026-59848Medium
Vulnerability in libssh. A malicious SFTP server can send responses for unknown request IDs, causing unbounded memory growth and client-side denial of service.
- CVE-2026-59847Medium
A flaw in libssh. Incorrect AES-GCM finalization checks in builds using the OpenSSL backend can effectively remove integrity protection, allowing an in-path attacker to modify plaintext on the wire without detection.
- CVE-2026-59846Low
A flaw in libssh: a malicious username expanded through %r in ProxyCommand handling can inject shell metacharacters, exposing environment variables and causing unintended shell behavior.
- CVE-2026-59845Medium
In libssh, when ProxyCommand is used, an unchecked fork() failure can result in storing PID -1. During cleanup, signals may be sent to processes in the caller's process tree, causing local denial of service.
- CVE-2026-59844Medium
A flaw in libssh: a remote authenticated client can issue SFTP_READ requests with an arbitrarily large length, causing the SFTP server to allocate excessive memory and potentially exhaust it.
- CVE-2026-59843Medium
A flaw in libssh: a remote authenticated peer can advertise a zero maximum packet size in SSH_MSG_CHANNEL_OPEN, causing infinite channel write loops and CPU exhaustion.
- CVE-2026-59842Low
In libssh, during server-side GSSAPI key exchange, a short Curve25519 public key is copied without proper length validation, causing an out-of-bounds heap read.
- CVE-2026-15370Medium
In libssh, during SFTP directory listing, the longname field is constructed via unsafe concatenation into a fixed-size stack buffer. Long filenames can overflow the buffer, leading to crashes or potential code execution on the server.
- CVE-2025-14821High
A flaw was found in libssh that allows local man-in-the-middle attacks, security downgrades of SSH connections, and manipulation of trusted host information. The vulnerability stems from an insecure default configuration on Windows systems where the library automatically loads configuration files from the C:\etc directory, which can be created and modified by unprivileged local users.
- CVE-2026-0968Low
A flaw was found in libssh in which a malicious SFTP server can exploit this by sending a malformed 'longname' field within an `SSH_FXP_NAME` message during a file listing operation. This missing null check can lead to reading beyond allocated memory on the heap, causing unexpected behavior or denial of service (DoS) due to application crashes.
- CVE-2026-0967Medium
A flaw was found in libssh. A remote attacker, by controlling client configuration files or known_hosts files, could craft specific hostnames that when processed by the `match_pattern()` function can lead to inefficient regular expression backtracking. This can cause timeouts and resource exhaustion, resulting in a Denial of Service (DoS) for the client.
- CVE-2026-0966High
A flaw was found in libssh. The API function `ssh_get_hexa()` is vulnerable to a denial of service when processing zero-length input. This can be exploited remotely by an attacker during GSSAPI authentication if the server's logging verbosity is set to `SSH_LOG_PACKET (3)` or higher. Successful exploitation could lead to a self-Denial of Service of the per-connection daemon process.
- CVE-2026-0965Low
A flaw was found in libssh where it can attempt to open arbitrary files during configuration parsing. A local attacker can exploit this by providing a malicious configuration file or when the system is misconfigured. This vulnerability could lead to a Denial of Service (DoS) by causing the system to try and access dangerous files, such as block devices or large system files, which can disrupt normal operations.
- CVE-2025-8277Low
A flaw was found in libssh's handling of key exchange (KEX) processes when a client repeatedly sends incorrect KEX guesses. The library fails to free memory during these rekey operations, which can gradually exhaust system memory, leading to crashes on the client side, particularly when using libgcrypt.
- CVE-2025-4877Medium
A vulnerability in the libssh library involves an integer overflow in the bin_to_base64() function when processing an unexpectedly large input buffer passed to ssh_get_fingerprint_hash(). This leads to memory under-allocation and out-of-bounds write, causing heap corruption. The issue affects only 32-bit builds of libssh.
- CVE-2025-5449Medium
A flaw was found in the SFTP server message decoding logic of libssh. An incorrect packet length check allows an integer overflow on 32-bit systems when handling large payload sizes, leading to failed memory allocation and server process crash, resulting in denial of service.
- CVE-2025-8114Medium
A flaw in libssh causes a NULL pointer dereference when calculating the session ID during the key exchange (KEX) process due to an allocation failure in cryptographic functions. This can crash the client or server.
- CVE-2025-4878Low
A vulnerability was found in libssh involving an uninitialized variable in the privatekey_from_file() function. It is triggered when the specified file does not exist, potentially leading to signing failures or heap corruption.
- CVE-2025-5987High
A flaw was found in libssh when using the ChaCha20 cipher with the OpenSSL library. If an attacker exhausts the heap space, the error is not detected and may lead to libssh using a partially initialized cipher context. This occurs because the OpenSSL error code aliases with SSH_OK, preventing proper error detection.
- CVE-2025-5351Medium
A double-free vulnerability was found in the key export functionality of libssh. During error handling, a memory structure is freed but not cleared, potentially leading to a double free if another failure occurs. This could cause heap corruption or application instability in low-memory scenarios.
- CVE-2025-5372Medium
A flaw was found in libssh versions built with OpenSSL versions older than 3.0, specifically in the ssh_kdf() function responsible for key derivation. Due to inconsistent interpretation of return values, the function may mistakenly return a success status even when key derivation fails.
- CVE-2025-5318Medium
A flaw was found in the libssh library in versions less than 0.11.2. An out-of-bounds read can be triggered in the sftp_handle function due to an incorrect comparison check that permits the function to access memory beyond the valid handle list and to return an invalid pointer. This vulnerability allows an authenticated remote attacker to potentially read unintended memory regions, exposing sensitive information or affect service behavior.

