CVE-2025-5987

CVE-2025-5987 is a high-severity vulnerability in Libssh with a CVSS 3.x base score of 8.1. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-393.

Key facts

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.

Frequently asked questions

What is CVE-2025-5987?
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.
How severe is CVE-2025-5987?
CVE-2025-5987 has a CVSS 3.x base score of 8.1, rated high severity. It is exploitable over network with high attack complexity, requires no privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability high.
Is CVE-2025-5987 being actively exploited?
It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (70th percentile), an estimate of the probability of exploitation in the next 30 days.
What products are affected by CVE-2025-5987?
CVE-2025-5987 affects Libssh. See the affected-products list for the exact vulnerable versions.
How do I fix CVE-2025-5987?
Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
Does CVE-2025-5987 have an EU (EUVD) identifier?
Yes. CVE-2025-5987 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2025-20227.
When was CVE-2025-5987 published?
CVE-2025-5987 was published on 2025-07-07 and last updated on 2026-06-30.

References

Affected products (1)

More vulnerabilities in Libssh

All CVEs affecting Libssh →

Other CWE-393 vulnerabilities

Browse all CWE-393 vulnerabilities →