← Vulnerability feed

Vulnerability record · CVE-2025-5987 · published 7 July 2025

CVE-2025-5987: Libssh vulnerability

Libssh · Libssh

A flaw was found in libssh when using the ChaCha20 cipher with the OpenSSL library. If an attacker manages to exhaust the heap space, this error is not detected and may lead to libssh using a partially initialized cipher context. This occurs because the OpenSSL error code returned aliases with the SSH_OK code, resulting in libssh not properly detecting the error returned by the OpenSSL library. This issue can lead to undefined behavior, including compromised data confidentiality and integrity or crashes.

8.1 CVSS 3.1 High EPSS 1.6% · top 25.0% CWE-393 · CWE-393
8.1CVSS 3.1 base score
1.6%EPSS exploitation probability, 30 days
NoNot in CISA KEV
1Affected product versions listed by NVD
17References
31 Aug 2026Last modified by NVD

Description

A flaw was found in libssh when using the ChaCha20 cipher with the OpenSSL library. If an attacker manages to exhaust the heap space, this error is not detected and may lead to libssh using a partially initialized cipher context. This occurs because the OpenSSL error code returned aliases with the SSH_OK code, resulting in libssh not properly detecting the error returned by the OpenSSL library. This issue can lead to undefined behavior, including compromised data confidentiality and integrity or crashes.

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected products

1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2025-5987 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

9.1CVE-2018-10933libssh server authentication bypass via channel creationlibssh's server-side state machine before 0.7.6 and 0.8.4 allows a client to create channels without completing authentication, bypassing the login s…EPSS 92%analysed8.8CVE-2026-59851Libssh incorrect authorization vulnerabilityA flaw was found in libssh. On servers with GSSAPIKeyExchange enabled, the gssapi-keyex path does not verify whether the authenticated Kerberos princ…EPSS 0.49%8.8CVE-2025-5372Libssh vulnerabilityA flaw was found in libssh versions built with OpenSSL versions older than 3.0, specifically in the ssh_kdf() function responsible for key derivation…EPSS 0.47%8.8CVE-2019-14889Libssh os command injection vulnerabilityA flaw was found with the libssh API function ssh_scp_new() in versions before 0.9.3 and before 0.8.8. When the libssh SCP client connects to a serve…EPSS 3.2%8.2CVE-2026-0966Libssh vulnerabilityA 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 exp…EPSS 0.58%7.5CVE-2026-59849Libssh vulnerabilityA flaw was found in libssh. Logic errors in automatic certificate-based public key authentication can cause libssh clients to loop indefinitely when …EPSS 0.44%7.5CVE-2026-59850Libssh use after free vulnerabilityA flaw was found in libssh. If data packets are processed after a channel is closed, channel data callbacks can be invoked after the associated data …EPSS 0.60%7.5CVE-2026-59847Libssh vulnerabilityA flaw was found in libssh. Incorrect AES-GCM finalization checks in builds using the OpenSSL backend can effectively remove integrity protection, al…EPSS 0.57%

Source: NIST National Vulnerability Database (record CVE-2025-5987), CISA KEV, FIRST EPSS (scores of 2026-09-27). This page is refreshed as NVD updates the record.