CVE-2025-5987
Libssh: invalid return code for chacha20 poly1305 with openssl backend
Reported by redhat · Published July 7, 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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| libssh | Wolfi | 0.11.3-r0 |
| libssh-devel | Amazon Linux | 0.10.6-1.amzn2023.0.2 |
| libssh | Amazon Linux | 0.10.6-1.amzn2023.0.2 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| 0.10.0 | ||
| 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 | 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 |
| 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 |
…and 37 more
Timeline
- Jun 29, 2025 CVE Published
- Jul 7, 2025 Coalition ESS Score (9 in total, the first dated here)
- Jul 8, 2025 EPSS Score (30 in total, the first dated here)
- Mar 17, 2026 Security Advisory (41 in total, the first dated here)
- Oct 20, 2026 Distribution Patch (38 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2025-5987
vulnetix vdb fixes CVE-2025-5987
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-5987/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- RHSA-2025:23483 vendor-advisoryx_refsource_REDHAT
- RHSA-2025:23484 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0427 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0428 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0430 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0431 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0702 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0978 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0980 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0985 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:0996 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:1539 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:1541 vendor-advisoryx_refsource_REDHAT
- RHSA-2026:3415 vendor-advisoryx_refsource_REDHAT
- vdb-entryx_refsource_REDHAT
- RHBZ#2376219 issue-trackingx_refsource_REDHAT