CVE-2025-5987Libssh: invalid return code for chacha20 poly1305 with openssl backend
- 8.1HighCVSS base score
- 1.7%Exploitation in 30 daysEPSS · top 22% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
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.
Timeline
ID reserved
By redhat
- 27 days later
· 27 days later
Published
- 16 months later
· 16 months later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| redhatCNA (assigner) | 3.1 | High8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVDNVD · Modified | 3.1 | High8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 1.7% · top 22% of all CVEs (14 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 8.1.
Affected products
libssh
- affected 0.10.0 – < 0.11.2
Red Hat · Red Hat Enterprise Linux 10
- unaffected 0:0.11.1-5.el10_1 – < *
Red Hat · Red Hat Enterprise Linux 10.0 Extended Update Support
- unaffected 0:0.11.1-4.el10_0.1 – < *
Red Hat · Red Hat Enterprise Linux 9
- unaffected 0:0.10.4-17.el9_7 – < *
Red Hat · Red Hat Enterprise Linux 9
- unaffected 0:0.10.4-17.el9_7 – < *
Red Hat · Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions
- unaffected 0:0.10.4-9.el9_2.2 – < *
Red Hat · Red Hat Enterprise Linux 9.4 Extended Update Support
- unaffected 0:0.10.4-13.el9_4.2 – < *
Red Hat · Red Hat Enterprise Linux 9.6 Extended Update Support
- unaffected 0:0.10.4-15.el9_6.1 – < *
Red Hat · Red Hat OpenShift Container Platform 4.13
- unaffected 413.92.202602240113-0 – < *
Red Hat · Red Hat OpenShift Container Platform 4.14
- unaffected 414.92.202601191325-0 – < *
Red Hat · Red Hat OpenShift Container Platform 4.15
- unaffected 415.92.202601271320-0 – < *
Red Hat · Red Hat OpenShift Container Platform 4.16
- unaffected 416.94.202601160124-0 – < *
Red Hat · Red Hat OpenShift Container Platform 4.17
- unaffected 417.94.202601120213-0 – < *
Red Hat · Red Hat OpenShift Container Platform 4.18
- unaffected 418.94.202601202224-0 – < *
Red Hat · Red Hat OpenShift Container Platform 4.19
- unaffected 4.19.9.6.202601260820-0 – < *
Red Hat · Red Hat OpenShift Container Platform 4.20
- unaffected 4.20.9.6.202601211057-0 – < *
Red Hat · Red Hat Enterprise Linux 6
All versions: unknown
Red Hat · Red Hat Enterprise Linux 7
All versions: unknown
Red Hat · Red Hat Enterprise Linux 8
All versions: unaffected
Red Hat · Red Hat OpenShift Container Platform 4
All versions: affected
What to do
Workaround: A workaround for this issue is to disable the [email protected] cipher in applications using libssh when libssh is compiled with the OpenSSL backend, so the vulnerable ChaCha20-Poly1305 initialization path is not used. Alternatively, upgrade to a version of libssh containing the fix; upstream has released libssh 0.11.2 to correct this defect, and administrators are advised to upgrade or apply the upstream patch as soon as possible.
References
References17
- RHSA-2025:23483 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2025:23484 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0427 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0428 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0430 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0431 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0702 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0978 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0980 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0985 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0996 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:1539 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:1541 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- RHSA-2026:3415 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2025-5987 (opens in a new tab)vdb-entryx_refsource_REDHAT
- RHBZ#2376219 (opens in a new tab)issue-trackingx_refsource_REDHAT
- https://www.libssh.org/security/advisories/CVE-2025-5987.txt (opens in a new tab)
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2025-20227 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2025-5987)Record last updated .