CVE-2025-5987 Libssh: invalid return code for chacha20 poly1305 with openssl backend
HighCVSS 8.1
EPSS 1.7%
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: total
- Technology
- OpenSSLUbuntuDebianRed Hat
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.
Upgrade path
17 packages: 15 fixed, 1 partially fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| redhat openshift | < 4.19.9.6.202601260820-0; < 4.20.9.6.202601211057-0; < 413.92.202602240113-0; < 414.92.202601191325-0 +5 more | 4.19.9.6.202601260820-0, 4.20.9.6.202601211057-0, 413.92.202602240113-0, 414.92.202601191325-0, 415.92.202601271320-0, 416.94.202601160124-0, 417.94.202601120213-0, 418.94.202601202224-0 | Partially fixed |
| alpine/libssh(Alpine v3.22) | >= 0.10.0, < 0.11.2-r0 | 0.11.2-r0 | Fixed |
| alpine/libssh(Alpine v3.23) | >= 0.10.0, < 0.11.2-r0 | 0.11.2-r0 | Fixed |
| alpine/libssh(Alpine v3.24) | >= 0.10.0, < 0.11.2-r0 | 0.11.2-r0 | Fixed |
| azure linux libssh(Azure Linux 3.0) | < 0.10.6-2 | 0.10.6-2 | Fixed |
| cbl-mariner libssh(CBL-Mariner 2.0) | < 0.10.6-2 | 0.10.6-2 | Fixed |
| debian/libssh(Debian 12) | < 0.10.6-0+deb12u2; = 0.10.5-2; = 0.10.5-3; = 0.10.5-3+hurd.1 +1 more | 0.10.6-0+deb12u2 | Fixed |
| debian/libssh(Debian 13) | < 0.11.2-1 | 0.11.2-1 | Fixed |
| debian/libssh(Debian 14) | < 0.11.2-1 | 0.11.2-1 | Fixed |
| libssh | >= 0.10.0, < 0.11.2 | 0.11.2 | Fixed |
| libssh | >= 0.10.0, < 0.11.2 | 0.11.2 | Fixed |
| redhat enterprise linux | < 0:0.10.4-17.el9_7; < 0:0.11.1-5.el10_1; = 8 | 0:0.10.4-17.el9_7, 0:0.11.1-5.el10_1 | Fixed |
| redhat enterprise linux eus | < 0:0.11.1-4.el10_0.1 | 0:0.11.1-4.el10_0.1 | Fixed |
| redhat rhel e4s | < 0:0.10.4-9.el9_2.2 | 0:0.10.4-9.el9_2.2 | Fixed |
| redhat rhel eus | < 0:0.10.4-13.el9_4.2; < 0:0.10.4-15.el9_6.1 | 0:0.10.4-13.el9_4.2, 0:0.10.4-15.el9_6.1 | Fixed |
| ubuntu/libssh(Ubuntu 24.04) | < 0.10.6-2ubuntu0.1 | 0.10.6-2ubuntu0.1 | Fixed |
| redhat rhel els | = 6; = 7 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| cbl-mariner libssh(CBL-Mariner:2.0) | < 0.10.6-2 | 0.10.6-2 |
| azure linux libssh(Azure Linux:3.0) | < 0.10.6-2 | 0.10.6-2 |
| debian/libssh(Debian:12) | < 0.10.6-0+deb12u2 | 0.10.6-0+deb12u2 |
| debian/libssh(Debian:12) | = 0.10.5-2 | No fix listed |
| debian/libssh(Debian:12) | = 0.10.5-3 | No fix listed |
| debian/libssh(Debian:12) | = 0.10.5-3+hurd.1 | No fix listed |
| debian/libssh(Debian:12) | = 0.10.6-0+deb12u1 | No fix listed |
| debian/libssh(Debian:13) | < 0.11.2-1 | 0.11.2-1 |
| debian/libssh(Debian:14) | < 0.11.2-1 | 0.11.2-1 |
| libssh | >= 0.10.0, < 0.11.2 | 0.11.2 |
| redhat enterprise linux | < 0:0.11.1-5.el10_1 | 0:0.11.1-5.el10_1 |
| redhat enterprise linux eus | < 0:0.11.1-4.el10_0.1 | 0:0.11.1-4.el10_0.1 |
| redhat enterprise linux | < 0:0.10.4-17.el9_7 | 0:0.10.4-17.el9_7 |
| redhat rhel e4s | < 0:0.10.4-9.el9_2.2 | 0:0.10.4-9.el9_2.2 |
| redhat rhel eus | < 0:0.10.4-13.el9_4.2 | 0:0.10.4-13.el9_4.2 |
| redhat rhel eus | < 0:0.10.4-15.el9_6.1 | 0:0.10.4-15.el9_6.1 |
| redhat openshift | < 413.92.202602240113-0 | 413.92.202602240113-0 |
| redhat openshift | < 414.92.202601191325-0 | 414.92.202601191325-0 |
| redhat openshift | < 415.92.202601271320-0 | 415.92.202601271320-0 |
| redhat openshift | < 416.94.202601160124-0 | 416.94.202601160124-0 |
| redhat openshift | < 417.94.202601120213-0 | 417.94.202601120213-0 |
| redhat openshift | < 418.94.202601202224-0 | 418.94.202601202224-0 |
| redhat openshift | < 4.19.9.6.202601260820-0 | 4.19.9.6.202601260820-0 |
| redhat openshift | < 4.20.9.6.202601211057-0 | 4.20.9.6.202601211057-0 |
| redhat rhel els | = 6 | No fix listed |
Show 7 more
| Product | Affected versions | Fixed in |
|---|---|---|
| redhat rhel els | = 7 | No fix listed |
| redhat enterprise linux | = 8 | No fix listed |
| redhat openshift | All versions | No fix listed |
| alpine/libssh(Alpine:v3.22) | >= 0.10.0, < 0.11.2-r0 | 0.11.2-r0 |
| alpine/libssh(Alpine:v3.23) | >= 0.10.0, < 0.11.2-r0 | 0.11.2-r0 |
| alpine/libssh(Alpine:v3.24) | >= 0.10.0, < 0.11.2-r0 | 0.11.2-r0 |
| ubuntu/libssh(Ubuntu:24.04) | < 0.10.6-2ubuntu0.1 | 0.10.6-2ubuntu0.1 |
References
- MSRC Security Update Guide vendor-advisory
- CBL-Mariner Releases vendor-advisory
- Debian Security Tracker CVE-2025-5987 vendor-advisory
- RHSA-2025:23483 vendor-advisory
- RHSA-2025:23484 vendor-advisory
- RHSA-2026:0427 vendor-advisory
- RHSA-2026:0428 vendor-advisory
- RHSA-2026:0430 vendor-advisory
- RHSA-2026:0431 vendor-advisory
- RHSA-2026:0702 vendor-advisory
- RHSA-2026:0978 vendor-advisory
- RHSA-2026:0980 vendor-advisory
- RHSA-2026:0985 vendor-advisory
- RHSA-2026:0996 vendor-advisory
- RHSA-2026:1539 vendor-advisory
- RHSA-2026:1541 vendor-advisory
- RHSA-2026:3415 vendor-advisory
- access.redhat.com third-party-advisory vdb-entry
- RHBZ#2376219 issue-tracking third-party-advisory
- www.libssh.org
- security.alpinelinux.org vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- USN-7619-1 vendor-advisory
- www.cve.org
- bugs.debian.org issue-tracking