Skip to content
Fencer Intel
high 8.1

CVE-2025-5987 json

Libssh: invalid return code for chacha20 poly1305 with openssl backend

published last yr. modified 4d ago also EUVD-2025-20227 , JLSEC-2025-332

cvss
8.1
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.7%
EPSS 1.7% chance of exploitation in 30 days, percentile 77%
public exploits
0
none known

Summary

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.

Patch / fix

  • julia libssh_jll 0.11.3+0
  • libssh.org libssh 0.11.2
  • Red Hat Red Hat Enterprise Linux 10 0:0.11.1-5.el10_1
  • Red Hat Red Hat Enterprise Linux 10.0 Extended Update Support 0:0.11.1-4.el10_0.1
  • Red Hat Red Hat Enterprise Linux 9 0:0.10.4-17.el9_7
  • Red Hat Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions 0:0.10.4-9.el9_2.2
  • Red Hat Red Hat Enterprise Linux 9.4 Extended Update Support 0:0.10.4-13.el9_4.2
  • Red Hat Red Hat Enterprise Linux 9.6 Extended Update Support 0:0.10.4-15.el9_6.1
  • Red Hat Red Hat OpenShift Container Platform 4.13 413.92.202602240113-0
  • Red Hat Red Hat OpenShift Container Platform 4.14 414.92.202601191325-0
  • Red Hat Red Hat OpenShift Container Platform 4.15 415.92.202601271320-0
  • Red Hat Red Hat OpenShift Container Platform 4.16 416.94.202601160124-0
  • Red Hat Red Hat OpenShift Container Platform 4.17 417.94.202601120213-0
  • Red Hat Red Hat OpenShift Container Platform 4.18 418.94.202601202224-0
  • Red Hat Red Hat OpenShift Container Platform 4.19 4.19.9.6.202601260820-0
  • Red Hat Red Hat OpenShift Container Platform 4.20 4.20.9.6.202601211057-0
  • libssh Debian 12 0.10.6-0+deb12u2
  • libssh Debian 14, Debian 13 0.11.2-1

debian advisories DEBIAN-CVE-2025-5987

  • libssh Ubuntu 24.04 LTS 0.10.6-2ubuntu0.1

ubuntu advisories UBUNTU-CVE-2025-5987

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • libssh RHEL 9 0.10.4-17.el9_7
  • libssh-config RHEL 9 0.10.4-17.el9_7
  • libssh RHEL 10.1 0.11.1-5.el10_1
  • libssh-config RHEL 10.1 0.11.1-5.el10_1
  • libssh RHEL 9.4 EUS 0.10.4-13.el9_4.2
  • libssh RHEL 9.2 E4S 0.10.4-9.el9_2.2
  • libssh RHEL 9.6 EUS 0.10.4-15.el9_6.1
  • libssh enterprise linux eus 10.0 0.11.1-4.el10_0.1

red hat advisories RHSA-2026:0431RHSA-2026:0430RHSA-2026:0428RHSA-2026:0427RHSA-2025:23483RHSA-2025:23484

  • libssh Linux Micro 6.1 0.10.6-slfo.1.1_2.1
  • libssh Linux Micro 6.0 0.10.6-2.1

suse advisories SUSE-SU-2025:20596-1SUSE-SU-2025:20557-1

  • libssh openSUSE Tumbleweed 0.11.2-1.1

opensuse advisories openSUSE-SU-2025:15243-1

  • libssh AlmaLinux 9 0.10.4-17.el9_7
  • libssh-config AlmaLinux 9 0.10.4-17.el9_7
  • libssh-config AlmaLinux 10 0.11.1-5.el10_1

almalinux advisories ALSA-2025:23483ALSA-2025:23484

  • libssh Rocky Linux 9 0.10.4-17.el9_7
  • libssh Rocky Linux 10 0.11.1-5.el10_1

rocky linux advisories RLSA-2025:23483RLSA-2025:23484

  • libssh Alpine 3.24, Alpine 3.23, Alpine 3.22 0.11.2-r0

alpine advisories ALPINE-CVE-2025-5987

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • libssh CBL-Mariner 2.0, Azure Linux 3.0 0.10.6-2

azure linux advisories AZL-64794AZL-64797

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Is CVE-2025-5987 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2025-5987 updated cvss 8.1

libssh: Invalid return code for chacha20 poly1305 with OpenSSL backend

  • Red Hat Enterprise Linux 6 libssh2 Red Hat Enterprise Linux 7 libssh2
    affected: workaround, no fix planned “Out of support scope”
  • Red Hat OpenShift Container Platform 4 openshift/ose-rhel-coreos-8
    affected: workaround, no fix available
  • Red Hat Enterprise Linux AppStream (v. 9) libssh-devel 0.10.4-17.el9_7, libssh-debuginfo 0.10.4-17.el9_7, libssh-debugsource 0.10.4-17.el9_7
    fixed: vendor fix RHSA-2025:23483
  • Red Hat Enterprise Linux AppStream (v. 10) libssh-devel 0.11.1-5.el10_1, libssh-debuginfo 0.11.1-5.el10_1, libssh-debugsource 0.11.1-5.el10_1
    fixed: vendor fix RHSA-2025:23484
  • Red Hat Enterprise Linux BaseOS (v. 9) libssh 0.10.4-17.el9_7, libssh-config 0.10.4-17.el9_7
    fixed: vendor fix RHSA-2025:23483
  • Red Hat Enterprise Linux BaseOS (v. 10) libssh 0.11.1-5.el10_1, libssh-config 0.11.1-5.el10_1
    fixed: vendor fix RHSA-2025:23484
  • Red Hat Enterprise Linux BaseOS E4S (v.9.2) libssh 0.10.4-9.el9_2.2
    fixed: vendor fix RHSA-2026:0430
  • Red Hat Enterprise Linux BaseOS EUS (v. 10.0) libssh 0.11.1-4.el10_0.1
    fixed: vendor fix RHSA-2026:0427
show 11 more
  • Red Hat Enterprise Linux BaseOS EUS (v.9.4) libssh 0.10.4-13.el9_4.2
    fixed: vendor fix RHSA-2026:0431
  • Red Hat Enterprise Linux BaseOS EUS (v.9.6) libssh 0.10.4-15.el9_6.1
    fixed: vendor fix RHSA-2026:0428
  • Red Hat OpenShift Container Platform 4.13 rhcos 413.92.202602240113
    fixed: vendor fix RHSA-2026:3415
  • Red Hat OpenShift Container Platform 4.14 rhcos 414.92.202601191325
    fixed: vendor fix RHSA-2026:0996
  • Red Hat OpenShift Container Platform 4.15 rhcos 415.92.202601271320
    fixed: vendor fix RHSA-2026:1541
  • Red Hat OpenShift Container Platform 4.16 rhcos 416.94.202601160124
    fixed: vendor fix RHSA-2026:0985
  • Red Hat OpenShift Container Platform 4.17 rhcos 417.94.202601120213
    fixed: vendor fix RHSA-2026:0702
  • Red Hat OpenShift Container Platform 4.18 rhcos 418.94.202601202224
    fixed: vendor fix RHSA-2026:0980
  • Red Hat OpenShift Container Platform 4.19 rhcos 9.6.20260123, rhcos 4.19.9.6.202601260820
    fixed: vendor fix RHSA-2026:1539
  • Red Hat OpenShift Container Platform 4.20 rhcos 4.20.9.6.202601211057
    fixed: vendor fix RHSA-2026:0978
  • Red Hat Enterprise Linux 8 libssh, libssh-config Red Hat Enterprise Linux AppStream E4S (v.9.2) libssh-devel 0.10.4-9.el9_2.2, libssh-debuginfo 0.10.4-9.el9_2.2, libssh-debugsource 0.10.4-9.el9_2.2 Red Hat Enterprise Linux AppStream EUS (v. 10.0) libssh-devel 0.11.1-4.el10_0.1, libssh-debuginfo 0.11.1-4.el10_0.1, libssh-debugsource 0.11.1-4.el10_0.1 Red Hat Enterprise Linux AppStream EUS (v.9.4) libssh-devel 0.10.4-13.el9_4.2, libssh-debuginfo 0.10.4-13.el9_4.2, libssh-debugsource 0.10.4-13.el9_4.2 Red Hat Enterprise Linux AppStream EUS (v.9.6) libssh-devel 0.10.4-15.el9_6.1, libssh-debuginfo 0.10.4-15.el9_6.1, libssh-debugsource 0.10.4-15.el9_6.1 Red Hat Enterprise Linux BaseOS E4S (v.9.2) libssh 0.10.4-9.el9_2.2, libssh-config 0.10.4-9.el9_2.2
    +3 more products
    Red Hat Enterprise Linux BaseOS EUS (v. 10.0) libssh 0.11.1-4.el10_0.1, libssh-config 0.11.1-4.el10_0.1 Red Hat Enterprise Linux BaseOS EUS (v.9.4) libssh 0.10.4-13.el9_4.2, libssh-config 0.10.4-13.el9_4.2 Red Hat Enterprise Linux BaseOS EUS (v.9.6) libssh 0.10.4-15.el9_6.1, libssh-config 0.10.4-15.el9_6.1
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
9mo ago

Exploit prediction

1.73% chance of exploitation in the next 30 days, higher than 77% of all scored CVEs (FIRST EPSS, 2026-11-09).

CVSS scores

assigned by version score vector
CNA 3.1 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
OSV 3.1 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
julia libssh_jll
<0.11.3+0
0.11.3+0

Affected products

  • libssh.org libssh
  • Red Hat Red Hat Enterprise Linux 10
  • Red Hat Red Hat Enterprise Linux 10.0 Extended Update Support
  • Red Hat Red Hat Enterprise Linux 9
  • Red Hat Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions
  • Red Hat Red Hat Enterprise Linux 9.4 Extended Update Support
  • Red Hat Red Hat Enterprise Linux 9.6 Extended Update Support
  • Red Hat Red Hat OpenShift Container Platform 4.13
  • Red Hat Red Hat OpenShift Container Platform 4.14
  • Red Hat Red Hat OpenShift Container Platform 4.15
  • Red Hat Red Hat OpenShift Container Platform 4.16
  • Red Hat Red Hat OpenShift Container Platform 4.17
  • Red Hat Red Hat OpenShift Container Platform 4.18
  • Red Hat Red Hat OpenShift Container Platform 4.19
  • Red Hat Red Hat OpenShift Container Platform 4.20
  • Red Hat Red Hat Enterprise Linux 6
  • Red Hat Red Hat Enterprise Linux 7
  • Red Hat Red Hat Enterprise Linux 8
  • Red Hat Red Hat OpenShift Container Platform 4

Classification

Weakness
  • CWE-393 Return of Wrong Status Code

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.

CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.