CVE-2025-5987
Libssh: invalid return code for chacha20 poly1305 with openssl backend
- State
- Published
- Severity
- 8.1 High
- Published
- Jul 7, 2025
- Updated
- Oct 16, 2026
- Reserved
- Jun 10, 2025
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.
Scores
| CVSS | Score | Vector | Source |
|---|---|---|---|
| 3.1 | 8.1 High | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H | redhat |
Weaknesses
- CWE-393 Return of Wrong Status Code
Affected Products
| Product | Versions |
|---|---|
libssh |
|
Red Hat Enterprise Linux 10Red Hat |
|
Red Hat Enterprise Linux 10.0 Extended Update SupportRed Hat |
|
Red Hat Enterprise Linux 9Red Hat |
|
Red Hat Enterprise Linux 9Red Hat |
|
Red Hat Enterprise Linux 9.2 Update Services for SAP SolutionsRed Hat |
|
Red Hat Enterprise Linux 9.4 Extended Update SupportRed Hat |
|
Red Hat Enterprise Linux 9.6 Extended Update SupportRed Hat |
|
Red Hat OpenShift Container Platform 4.13Red Hat |
|
Red Hat OpenShift Container Platform 4.14Red Hat |
|
Red Hat OpenShift Container Platform 4.15Red Hat |
|
Red Hat OpenShift Container Platform 4.16Red Hat |
|
Red Hat OpenShift Container Platform 4.17Red Hat |
|
Red Hat OpenShift Container Platform 4.18Red Hat |
|
Red Hat OpenShift Container Platform 4.19Red Hat |
|
Red Hat OpenShift Container Platform 4.20Red Hat |
|
Red Hat Enterprise Linux 6Red Hat | |
Red Hat Enterprise Linux 7Red Hat | |
Red Hat Enterprise Linux 8Red Hat | |
Red Hat OpenShift Container Platform 4Red Hat |
References
- RHSA-2025:23483vendor-advisory
- RHSA-2025:23484vendor-advisory
- RHSA-2026:0427vendor-advisory
- RHSA-2026:0428vendor-advisory
- RHSA-2026:0430vendor-advisory
- RHSA-2026:0431vendor-advisory
- RHSA-2026:0702vendor-advisory
- RHSA-2026:0978vendor-advisory
- RHSA-2026:0980vendor-advisory
- RHSA-2026:0985vendor-advisory
- RHSA-2026:0996vendor-advisory
- RHSA-2026:1539vendor-advisory
- RHSA-2026:1541vendor-advisory
- RHSA-2026:3415vendor-advisory
- https://access.redhat.com/security/cve/CVE-2025-5987vdb-entry
- RHBZ#2376219issue-tracking
- https://www.libssh.org/security/advisories/CVE-2025-5987.txt
Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.