cve.bz

CVE-2025-5987 Libssh: invalid return code for chacha20 poly1305 with openssl backend

8.1 highEPSS 2.3%Fix available

High (8.1) in libssh libssh. EPSS 2.3% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

8.1 high
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
2.3% (up from 1.7% a week ago; 1.7% 30 days ago) estimated probability of exploitation activity in the next 30 days; 84th percentile. Scored 2026-11-30. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-01-22. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-393 Return of Wrong Status Code
Published
Modified
Assigned by
redhat (CNA)
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

  • Red Hat Red Hat Enterprise Linux 10: fixed in 0:0.11.1-5.el10_1
  • Red Hat Red Hat Enterprise Linux 10.0 Extended Update Support: fixed in 0:0.11.1-4.el10_0.1
  • Red Hat Red Hat Enterprise Linux 9: fixed in 0:0.10.4-17.el9_7
  • Red Hat Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions: fixed in 0:0.10.4-9.el9_2.2
  • Red Hat Red Hat Enterprise Linux 9.4 Extended Update Support: fixed in 0:0.10.4-13.el9_4.2
  • Red Hat Red Hat Enterprise Linux 9.6 Extended Update Support: fixed in 0:0.10.4-15.el9_6.1
  • Red Hat Red Hat OpenShift Container Platform 4.13: fixed in 413.92.202602240113-0
  • Red Hat Red Hat OpenShift Container Platform 4.14: fixed in 414.92.202601191325-0
  • Debian, Ubuntu, Red Hat, SUSE, openSUSE, AlmaLinux, Rocky Linux, Alpine, Azure Linux, Alpaquita: fixed package versions per release

Ask an AI about this CVE

Show the promptExplain CVE-2025-5987 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-5987?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-5987?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-5987 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
libsshfrom 0.10.0 before 0.11.2

Fixed in

ProductFixed in
Red Hat Enterprise Linux 100:0.11.1-5.el10_1
Red Hat Enterprise Linux 10.0 Extended Update Support0:0.11.1-4.el10_0.1
Red Hat Enterprise Linux 90:0.10.4-17.el9_7
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions0:0.10.4-9.el9_2.2
Red Hat Enterprise Linux 9.4 Extended Update Support0:0.10.4-13.el9_4.2
Red Hat Enterprise Linux 9.6 Extended Update Support0:0.10.4-15.el9_6.1
Red Hat OpenShift Container Platform 4.13413.92.202602240113-0
Red Hat OpenShift Container Platform 4.14414.92.202601191325-0
Red Hat OpenShift Container Platform 4.15415.92.202601271320-0
Red Hat OpenShift Container Platform 4.16416.94.202601160124-0
Red Hat OpenShift Container Platform 4.17417.94.202601120213-0
Red Hat OpenShift Container Platform 4.18418.94.202601202224-0
Red Hat OpenShift Container Platform 4.194.19.9.6.202601260820-0
Red Hat OpenShift Container Platform 4.204.20.9.6.202601211057-0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12libssh0.10.6-0+deb12u2DEBIAN-CVE-2025-5987
Debian13, 14libssh0.11.2-1DEBIAN-CVE-2025-5987
Ubuntu22.04:LTSlibssh0.9.6-2ubuntu0.22.04.4USN-7619-1
Ubuntu24.04:LTSlibssh0.10.6-2ubuntu0.1UBUNTU-CVE-2025-5987 USN-7619-1
Red Hatenterprise_linux:9::appstreamlibssh-devel, libssh-debuginfo, libssh-debugsource0:0.10.4-17.el9_7RHSA-2025:23483
Red Hatenterprise_linux:9::baseoslibssh, libssh-config, libssh-debuginfo and 1 more0:0.10.4-17.el9_7RHSA-2025:23483
Red Hatenterprise_linux:10.1libssh, libssh-devel, libssh-config and 2 more0:0.11.1-5.el10_1RHSA-2025:23484
Red Hatenterprise_linux_eus:10.0libssh0:0.11.1-4.el10_0.1RHSA-2026:0427
Red Hatrhel_e4s:9.2::baseoslibssh0:0.10.4-9.el9_2.2RHSA-2026:0430
Red Hatrhel_eus:9.4::baseoslibssh0:0.10.4-13.el9_4.2RHSA-2026:0431
Red Hatrhel_eus:9.6::baseoslibssh0:0.10.4-15.el9_6.1RHSA-2026:0428
SUSELinux Micro 6.0libssh0.10.6-2.1SUSE-SU-2025:20557-1
SUSELinux Micro 6.1libssh0.10.6-slfo.1.1_2.1SUSE-SU-2025:20596-1
openSUSETumbleweedlibssh0.11.2-1.1openSUSE-SU-2025:15243-1
AlmaLinux9libssh, libssh-devel, libssh-config0.10.4-17.el9_7ALSA-2025:23483
AlmaLinux10libssh-config0.11.1-5.el10_1ALSA-2025:23484
Rocky Linux9libssh0:0.10.4-17.el9_7RLSA-2025:23483
Rocky Linux10libssh0:0.11.1-5.el10_1RLSA-2025:23484
Alpinev3.22, v3.23, v3.24libssh0.11.2-r0ALPINE-CVE-2025-5987
Azure Linux2libssh0.10.6-2AZL-64794
Azure Linux3libssh0.10.6-2AZL-64797
Alpaquita23, 25, streamlibssh0.11.2-r0BELL-CVE-2025-5987

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

Red Hat Product Security Team has rated this vulnerability as having a Moderate security impact. This is due to the high complexity in exploiting this flaw. For a successful attack to take place an attacker needs to manage to exhaust the heap space to for the OpenSSL library to return the error code which wrongly match the SSH_OK return code.

Red Hat's mitigation

A workaround for this issue is to disable the chacha20-poly1305@openssh.com 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.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10libssh-0:0.11.1-5.el10_1Fixed 2025-12-17RHSA-2025:23484
Red Hat Enterprise Linux 10.0 Extended Update Supportlibssh-0:0.11.1-4.el10_0.1Fixed 2026-01-12RHSA-2026:0427
Red Hat Enterprise Linux 9libssh-0:0.10.4-17.el9_7Fixed 2025-12-18RHSA-2025:23483
Red Hat Enterprise Linux 9.2 Update Services for SAP Solutionslibssh-0:0.10.4-9.el9_2.2Fixed 2026-01-12RHSA-2026:0430
Red Hat Enterprise Linux 9.4 Extended Update Supportlibssh-0:0.10.4-13.el9_4.2Fixed 2026-01-12RHSA-2026:0431
Red Hat Enterprise Linux 9.6 Extended Update Supportlibssh-0:0.10.4-15.el9_6.1Fixed 2026-01-12RHSA-2026:0428
Red Hat OpenShift Container Platform 4.13openshift/ose-rhel-coreos-9:413.92.202602240113-0Fixed 2026-03-05RHSA-2026:3415
Red Hat OpenShift Container Platform 4.14openshift/ose-rhel-coreos-9:414.92.202601191325-0Fixed 2026-01-30RHSA-2026:0996
Red Hat OpenShift Container Platform 4.15openshift/ose-rhel-coreos-9:415.92.202601271320-0Fixed 2026-02-05RHSA-2026:1541
Red Hat OpenShift Container Platform 4.16openshift/ose-rhel-coreos-9:416.94.202601160124-0Fixed 2026-01-30RHSA-2026:0985
Red Hat OpenShift Container Platform 4.17openshift/ose-rhel-coreos-9:417.94.202601120213-0Fixed 2026-01-22RHSA-2026:0702
Red Hat OpenShift Container Platform 4.18openshift/ose-rhel-coreos-9:418.94.202601202224-0Fixed 2026-02-03RHSA-2026:0980
Red Hat OpenShift Container Platform 4.19openshift/ose-rhel-coreos-9:4.19.9.6.202601260820-0Fixed 2026-02-04RHSA-2026:1539
Red Hat OpenShift Container Platform 4.20openshift/ose-rhel-coreos-9:4.20.9.6.202601211057-0Fixed 2026-01-27RHSA-2026:0978
Red Hat Enterprise Linux 6libssh2Out of support scope
Red Hat Enterprise Linux 7libssh2Out of support scope
Red Hat Enterprise Linux 8libsshNot affected
Red Hat OpenShift Container Platform 4openshift/ose-rhel-coreos-8Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-5987.

References

Check your stackJSON