CVE-2025-4878
LowCVSS 3.6Exploitation Probability (EPSS)
Low risk8th percentile - higher than 8% of all known CVEs
Summary
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.
Risk Assessment
The risk includes potential heap corruption and unpredictable signing behavior, which could cause service crashes or compromise data integrity.
Recommendation
It is recommended to update libssh to the latest patched version and ensure that applications using libssh are properly protected against this vulnerability.
Other vulnerabilities in libssh
See all- CVE-2026-3731Medium
In libssh up to 0.11.3, the functions sftp_extensions_get_name and sftp_extensions_get_data in src/sftp.c (SFTP Extension Name Handler component) can cause an out-of-bounds read when the idx argument is manipulated. The attack may be performed remotely. Upgrading to version 0.11.4 or 0.12.0 resolves the issue (patch 855a0853ad3abd4a6cd85ce06fce6d8d4c7a0b60).
- CVE-2023-1667Medium
A NULL pointer dereference was found in libssh during re-keying with algorithm guessing. This issue may allow an authenticated client to cause a denial of service.
- 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.
Original NVD description (English source)
A vulnerability was found in libssh, where an uninitialized variable exists under certain conditions in the privatekey_from_file() function. This flaw can be triggered if the file specified by the filename doesn't exist and may lead to possible signing failures or heap corruption.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

