« List of all CVEs

CVE-2025-5987

Libssh: invalid return code for chacha20 poly1305 with openssl backend

Published: 7/7/2025 Last updated: 11/21/2025 Reserved: 6/10/2025

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.

CNA assigner: redhat (53f830b8-0a3f-465b-8143-3b8a9948e749) Requested by: n/a

Metrics

Version Score Severity Vector String
3.1 5 Medium CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L

Opam packages affected (1)

libssh

Products affected (13)

Product Vendor Version
Red Hat Enterprise Linux 9 Red Hat 15.2(3)EA
<= 2023.2.0.73
Red Hat Enterprise Linux 9 Red Hat < 3.2.11aSG
Red Hat Enterprise Linux 10 Red Hat <= 7.69.1
15.2(2)EA2
Red Hat Enterprise Linux 10 Red Hat 6.0.2
Red Hat Enterprise Linux 8 Red Hat <= 1.1.3
Red Hat Enterprise Linux 6 Red Hat <= 7.69.0
Red Hat Enterprise Linux 7 Red Hat n/a
Red Hat Enterprise Linux 7 Red Hat and 7.x-5.x before 7.x-5.4
Red Hat Enterprise Linux 6 Red Hat QCA9377
Red Hat OpenShift Container Platform 4 Red Hat < publication
Red Hat OpenShift Container Platform 4 Red Hat <= 7.68.0

References (4)