# CVE-2025-5987: Libssh: invalid return code for chacha20 poly1305 with openssl backend

CVE-2025-5987 is fixed in 7 products on 1 platform, first by RHSA-2026:0427, released April 26, 2025. It is not reported as exploited. Patch Radar priority: High.

- Web page: https://patchblox.com/security/cve/CVE-2025-5987
- Priority: High
- CVSS: 8.1 (Moderate)
- EPSS: 0.0173
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Apr 26, 2025
- Weakness: Return of Wrong Status Code
- Vendor advisory: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-5987

## Description

A flaw was found in libssh when using the ChaCha20 cipher with the OpenSSLlibrary. If an attacker manages to exhaust the heap space, this error isnot detected and may lead to libssh using a partially initialized ciphercontext. This occurs because the OpenSSL error code returned aliases withthe SSH_OK code, resulting in libssh not properly detecting the errorreturned by the OpenSSL library. This issue can lead to undefined behavior,including compromised data confidentiality and integrity or crashes.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | libssh Debian 12.15 (bookworm) | 0.10.6-0+deb12u2 | [DEBIAN-CVE-2025-5987](https://patchblox.com/security/data/fix/linux/debian-cve-2025-5987.md) | Jul 7, 2025 |
| Linux | libssh Debian 13.5 (trixie) | 0.11.2-1 | [DEBIAN-CVE-2025-5987](https://patchblox.com/security/data/fix/linux/debian-cve-2025-5987.md) | Jul 7, 2025 |
| Linux | libssh Debian 14 | 0.11.2-1 | [DEBIAN-CVE-2025-5987](https://patchblox.com/security/data/fix/linux/debian-cve-2025-5987.md) | Jul 7, 2025 |
| Linux | libssh RHEL 10 | 0.11.1-4.el10_0.1 | [RHSA-2026:0427](https://patchblox.com/security/data/fix/linux/rhsa-2026-0427.md) | Apr 26, 2025 |
| Linux | libssh RHEL 9 | 0:0.10.4-17.el9_7 | [RHSA-2025:23483](https://patchblox.com/security/data/fix/linux/rhsa-2025-23483.md) | Jan 16, 2026 |
| Linux | libssh almalinux 9 | 0.10.4-17.el9_7 | [ALSA-2025:23483](https://patchblox.com/security/data/fix/linux/alsa-2025-23483.md) | Dec 17, 2025 |
| Linux | libssh amzn 2023 | 0.10.6-1.amzn2023.0.2 | [ALAS2023-2025-1155](https://patchblox.com/security/data/fix/linux/alas2023-2025-1155.md) | Aug 18, 2025 |
| Linux | libssh ol 10 | 0:0.11.1-5.el10_1 | [ELSA-2025-23484](https://patchblox.com/security/data/fix/linux/elsa-2025-23484.md) | Dec 17, 2025 |
| Linux | libssh ol 9 | 0:0.10.4-17.el9_7 | [ELSA-2025-23483](https://patchblox.com/security/data/fix/linux/elsa-2025-23483.md) | Dec 18, 2025 |
| Linux | libssh rocky 10 | 0:0.11.1-5.el10_1 | [RLSA-2025:23484](https://patchblox.com/security/data/fix/linux/rlsa-2025-23484.md) | Dec 18, 2025 |
| Linux | libssh rocky 9 | 0:0.10.4-17.el9_7 | [RLSA-2025:23483](https://patchblox.com/security/data/fix/linux/rlsa-2025-23483.md) | Dec 19, 2025 |
| Linux | libssh-4 Ubuntu 24.04.5 LTS (noble) | 0.10.6-2ubuntu0.1 | [libssh-4 0.10.6-2ubuntu0.1](https://patchblox.com/security/data/fix/linux/ubuntu-noble-libssh-4-0.10.6-2ubuntu0.1.md) | Jun 24, 2025 |
| Linux | libssh-4 Ubuntu 24.10 (oracular) | 0.10.6-3ubuntu1.1 | [libssh-4 0.10.6-3ubuntu1.1](https://patchblox.com/security/data/fix/linux/ubuntu-oracular-libssh-4-0.10.6-3ubuntu1.1.md) | Jun 25, 2025 |
| Linux | libssh-4 Ubuntu 25.04 (plucky) | 0.11.1-1ubuntu0.1 | [libssh-4 0.11.1-1ubuntu0.1](https://patchblox.com/security/data/fix/linux/ubuntu-plucky-libssh-4-0.11.1-1ubuntu0.1.md) | Jun 25, 2025 |
| Linux | libssh-config RHEL 9 | 0:0.10.4-17.el9_7 | [RHSA-2025:23483](https://patchblox.com/security/data/fix/linux/rhsa-2025-23483.md) | Jan 16, 2026 |
| Linux | libssh-config almalinux 10 | 0.11.1-5.el10_1 | [ALSA-2025:23484](https://patchblox.com/security/data/fix/linux/alsa-2025-23484.md) | Dec 17, 2025 |
| Linux | libssh-config almalinux 9 | 0.10.4-17.el9_7 | [ALSA-2025:23483](https://patchblox.com/security/data/fix/linux/alsa-2025-23483.md) | Dec 17, 2025 |
| Linux | libssh-config amzn 2023 | 0.10.6-1.amzn2023.0.2 | [ALAS2023-2025-1155](https://patchblox.com/security/data/fix/linux/alas2023-2025-1155.md) | Aug 18, 2025 |
| Linux | libssh-config ol 10 | 0:0.11.1-5.el10_1 | [ELSA-2025-23484](https://patchblox.com/security/data/fix/linux/elsa-2025-23484.md) | Dec 17, 2025 |
| Linux | libssh-config ol 9 | 0:0.10.4-17.el9_7 | [ELSA-2025-23483](https://patchblox.com/security/data/fix/linux/elsa-2025-23483.md) | Dec 18, 2025 |
| Linux | libssh-debuginfo amzn 2023 | 0.10.6-1.amzn2023.0.2 | [ALAS2023-2025-1155](https://patchblox.com/security/data/fix/linux/alas2023-2025-1155.md) | Aug 18, 2025 |
| Linux | libssh-debugsource amzn 2023 | 0.10.6-1.amzn2023.0.2 | [ALAS2023-2025-1155](https://patchblox.com/security/data/fix/linux/alas2023-2025-1155.md) | Aug 18, 2025 |
| Linux | libssh-devel RHEL 9 | 0:0.10.4-17.el9_7 | [RHSA-2025:23483](https://patchblox.com/security/data/fix/linux/rhsa-2025-23483.md) | Jan 16, 2026 |
| Linux | libssh-devel almalinux 9 | 0.10.4-17.el9_7 | [ALSA-2025:23483](https://patchblox.com/security/data/fix/linux/alsa-2025-23483.md) | Dec 17, 2025 |
| Linux | libssh-devel amzn 2023 | 0.10.6-1.amzn2023.0.2 | [ALAS2023-2025-1155](https://patchblox.com/security/data/fix/linux/alas2023-2025-1155.md) | Aug 18, 2025 |
| Linux | libssh-devel ol 10 | 0:0.11.1-5.el10_1 | [ELSA-2025-23484](https://patchblox.com/security/data/fix/linux/elsa-2025-23484.md) | Dec 17, 2025 |
| Linux | libssh-devel ol 9 | 0:0.10.4-17.el9_7 | [ELSA-2025-23483](https://patchblox.com/security/data/fix/linux/elsa-2025-23483.md) | Dec 18, 2025 |
| Linux | libssh-gcrypt-4 Ubuntu 24.04.5 LTS (noble) | 0.10.6-2ubuntu0.1 | [libssh-gcrypt-4 0.10.6-2ubuntu0.1](https://patchblox.com/security/data/fix/linux/ubuntu-noble-libssh-gcrypt-4-0.10.6-2ubuntu0.1.md) | Jun 24, 2025 |
| Linux | libssh-gcrypt-4 Ubuntu 24.10 (oracular) | 0.10.6-3ubuntu1.1 | [libssh-gcrypt-4 0.10.6-3ubuntu1.1](https://patchblox.com/security/data/fix/linux/ubuntu-oracular-libssh-gcrypt-4-0.10.6-3ubuntu1.1.md) | Jun 25, 2025 |

---

Data as of 2026-11-08T06:59:42Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
