Skip to main content
No exploitation reportedFix available

CVE-2025-5987

Libssh: invalid return code for chacha20 poly1305 with openssl backend

No exploitation reported by the sources we read.

  • Published2025-07-07
  • Fixed in0.11.2
  • WeaknessCWE-393

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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

dates in UTC
  1. 2025-07-0714:24CVE publishedCNA

Versions per branch

NVD
Libssh
BranchAffectedFixed in
0.x≥ 0.10.0, < 0.11.20.11.2

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA19 products

As redhat, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

13 more products in the CVE record.

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2026-11-05

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • libsshWolfiall versions · fixed in 0.11.3-r0
  • libsshUbuntu:24.04:LTSall versions · fixed in 0.10.6-2ubuntu0.1
  • libsshUbuntu:22.04:LTSall versions · fixed in 0.9.6-2ubuntu0.22.04.4
  • libsshTuxCare:AlmaLinux:9.6all versions · fixed in 0.10.4-15.el9_6.tuxcare.els1and 2 other packages
  • libsshTuxCare:AlmaLinux:9.2all versions · fixed in 0.10.4-8.el9.tuxcare.els6and 2 other packages
  • libsshSUSE:Linux Micro 6.1all versions · fixed in 0.10.6-slfo.1.1_2.1
  • libsshSUSE:Linux Micro 6.0all versions · fixed in 0.10.6-2.1
  • libsshRocky Linux:10all versions · fixed in 0:0.11.1-5.el10_1

31 more package ranges on OSV.dev

Vendor advisories

  • CVE-2025-5987 Red Hat Product Security110 products fixed · 9 known affected

    libssh: Invalid return code for chacha20 poly1305 with OpenSSL backend

    libssh2 as a component of Red Hat Enterprise Linux 6 · libssh2-devel as a component of Red Hat Enterprise Linux 6 · libssh2-docs as a component of Red Hat Enterprise Linux 6 · +6 more

  • RHSA-2026:3415 Red Hat Product Security1 product fixed

    Red Hat Security Advisory: OpenShift Container Platform 4.13.64 bug fix and security update

  • RHSA-2026:1541 Red Hat Product Security4 products fixed

    Red Hat Security Advisory: OpenShift Container Platform 4.15.61 bug fix and security update

  • RHSA-2026:1539 Red Hat Product Security8 products fixed

    Red Hat Security Advisory: OpenShift Container Platform 4.19.23 bug fix and security update

  • RHSA-2026:0980 Red Hat Product Security4 products fixed

    Red Hat Security Advisory: OpenShift Container Platform 4.18.32 bug fix and security update

  • RHSA-2026:0996 Red Hat Product Security4 products fixed

    Red Hat Security Advisory: OpenShift Container Platform 4.14.61 bug fix and security update

9 more advisories

Full record on NVD

Fix

  1. Update Libssh to 0.11.2
  2. Vendor fix Red Hat Product Security RHSA-2026:3415 · 1 productFor OpenShift Container Platform 4.13 see the following documentation, which will be updated shortly for this release, for important instructions on how to upgrade your cluster and fully apply this asynchronous errata update: https://docs.redhat.com/en/documentation/openshift_container_platform/4.…
  3. Vendor fix Red Hat Product Security RHSA-2026:1541 · 4 productsFor OpenShift Container Platform 4.15 see the following documentation, which will be updated shortly for this release, for important instructions on how to upgrade your cluster and fully apply this asynchronous errata update: https://docs.redhat.com/en/documentation/openshift_container_platform/4.…
  4. Vendor fix Red Hat Product Security RHSA-2026:1539 · 8 productsFor OpenShift Container Platform 4.19 see the following documentation, which will be updated shortly for this release, for important instructions on how to upgrade your cluster and fully apply this asynchronous errata update: https://docs.redhat.com/en/documentation/openshift_container_platform/4.…
  5. Vendor fix Red Hat Product Security RHSA-2026:0980 · 4 productsFor OpenShift Container Platform 4.18 see the following documentation, which will be updated shortly for this release, for important instructions on how to upgrade your cluster and fully apply this asynchronous errata update: https://docs.redhat.com/en/documentation/openshift_container_platform/4.…
  6. Vendor fix Red Hat Product Security RHSA-2026:0996 · 4 productsFor OpenShift Container Platform 4.14 see the following documentation, which will be updated shortly for this release, for important instructions on how to upgrade your cluster and fully apply this asynchronous errata update: https://docs.redhat.com/en/documentation/openshift_container_platform/4.…
  7. Vendor fix Red Hat Product Security RHSA-2026:0985 · 4 productsFor OpenShift Container Platform 4.16 see the following documentation, which will be updated shortly for this release, for important instructions on how to upgrade your cluster and fully apply this asynchronous errata update: https://docs.redhat.com/en/documentation/openshift_container_platform/4.…

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Published
2025-07-07
Last Modified
2026-11-05
NVD status
Modified
GitHub Advisory
GHSA-3pvj-q7qj-89fg

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.

Is CVE-2025-5987 actively exploited?

Active exploitation of CVE-2025-5987 has not been confirmed. Its EPSS score was 1.7% on 2026-11-08, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2025-5987?

CVE-2025-5987 has a CVSS v3 base score of 8.1 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.

Running libssh? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record