Vulnerability in Libssh

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.

Published · last modified .

CVSS v3 metric

CVSS v3 base score 8.1 (High). Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.

EPSS exploit prediction

EPSS: 0.017 (77.2th percentile), scored .

Low probability of exploitation in the next 30 days, but still tracked. 77th percentile — 77.2% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.

EPSS trend (30 days)EPSS over the last 30 days for CVE-2025-5987: held from 0.015 to 0.017.

EPSS over last 30 days · oldest: 0.015 · newest: 0.017 · change: +0.002

Affected products

Weakness classification (CWE)

Public proof-of-concept exploits

References

Frequently asked questions

What is CVE-2025-5987?
CVE-2025-5987 is a high-severity vulnerability in Libssh, classified under CWE-393. CVSS score: 8.1/10. Published 2025-07-07.
How severe is CVE-2025-5987?
High severity. CVSS v3 base score is 8.1 out of 10.
Is CVE-2025-5987 known to be exploited?
1 public proof-of-concept repositories are indexed. Not currently listed in the CISA KEV catalog.