Quick answers
- Is CVE-2025-5987 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2025-5987 being exploited in the wild.
- How severe is CVE-2025-5987?
- High severity, with a CVSS score of 8.1, published 7 July 2025.
- Which products and versions are affected?
- Libssh >= 0.10.0, < 0.11.2; Red Hat Enterprise Linux 10 libssh < 0.11.1-5.el10_1; Red Hat Enterprise Linux 9 libssh < 0.10.4-17.el9_7.
- Is there a fix for CVE-2025-5987?
- A patch was published on 2025-12-17: Red Hat released security advisories RHSA-2025:23483 and RHSA-2025:23484 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2025-5987 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2025-5987?
- Check whether you run Libssh, Red Hat Enterprise Linux 10 or Red Hat Enterprise Linux 9 at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
Technical details
A vulnerability exists in libssh's OpenSSL backend when handling the ChaCha20-Poly1305 cipher. The root cause is a return code aliasing issue where an OpenSSL error code (typically resulting from heap exhaustion during cipher initialization) is incorrectly interpreted as SSH_OK. This leads to the use of a partially initialized or uninitialized cipher context. An attacker who can influence memory pressure or trigger specific allocation failures could potentially cause undefined behavior, including memory corruption, crashes, or the compromise of encrypted communication. The issue is fixed in libssh 0.11.2 and 0.12.0, with backported patches available for various Red Hat Enterprise Linux versions.
Affected products
- libssh libssh >= 0.10.0, < 0.11.2
- Red Hat Red Hat Enterprise Linux 9 libssh < 0.10.4-17.el9_7
- Red Hat Red Hat Enterprise Linux 10 libssh < 0.11.1-5.el10_1
Timeline
- 2025-07-07: disclosed: Initial CVE publication date
- 2025-12-17: patched: Red Hat released security advisories RHSA-2025:23483 and RHSA-2025:23484
References
- https://www.libssh.org/
- https://access.redhat.com/downloads/content/package-browser/
- https://access.redhat.com/errata/RHSA-2025:23483
- https://access.redhat.com/errata/RHSA-2025:23484
- https://access.redhat.com/errata/RHSA-2026:0427
- https://access.redhat.com/errata/RHSA-2026:0428
- https://access.redhat.com/errata/RHSA-2026:0430