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

- Priority: **Prioritise**
- Reason: Severe, CVSS 8.1 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 2% (FIRST, 04-12-2026)
- Next step: Check applicability: affected before 0.11.2 (CNA); fix release not confirmed
- Status: published
- Published: 2025-07-07 · Modified: 2026-11-23
- Aliases: RHSA-2025:23483, RHSA-2025:23484, RHSA-2026:0427, RHSA-2026:0428, RHSA-2026:0430, RHSA-2026:0431, UBUNTU-CVE-2025-5987, DEBIAN-CVE-2025-5987, CGA-4fgm-6234-7qmm, CGA-cw25-pwg9-4chh, CGA-qf84-4245-vmrm, CGA-w6r9-4r92-mwr2, ALPINE-CVE-2025-5987
- Record: https://cvemate.com/vulnerability/CVE-2025-5987 · JSON: https://cvemate.com/vulnerability/CVE-2025-5987/json

## Description

```text
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.
```

## Signals

- CVSS: 8.1 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 1.804%, percentile 79.303%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine libssh (Alpine Linux): ≥ 0.10.0, \< 0.11.2-r0
- chainguard libssh (Chainguard): \< 0.11.3-r0
- chainguard libssh2 (Chainguard): \< 1.11.1-r1
- wolfi libssh (Wolfi): \< 0.11.3-r0
- wolfi libssh2 (Wolfi): \< 1.11.1-r1
- debian libssh (Debian): \< 0.10.6-0+deb12u2 \| \< 0.11.2-1
- ubuntu libssh (Ubuntu): \< 0.10.6-2ubuntu0.1
- libssh libssh: ≥ 0.10.0, \< 0.11.2
- redhat libssh (Red Hat): \< 0:0.10.4-17.el9\_7 \| \< 0:0.11.1-5.el10\_1 \| \< 0:0.11.1-4.el10\_0.1 \| \< 0:0.10.4-15.el9\_6.1 \| \< 0:0.10.4-9.el9\_2.2 \| \< 0:0.10.4-13.el9\_4.2
- redhat libssh-config (Red Hat): \< 0:0.10.4-17.el9\_7 \| \< 0:0.11.1-5.el10\_1
- redhat libssh-debuginfo (Red Hat): \< 0:0.10.4-17.el9\_7 \| \< 0:0.11.1-5.el10\_1
- redhat libssh-debugsource (Red Hat): \< 0:0.10.4-17.el9\_7 \| \< 0:0.11.1-5.el10\_1
- redhat libssh-devel (Red Hat): \< 0:0.10.4-17.el9\_7 \| \< 0:0.11.1-5.el10\_1

## References (first 20 of 34)

- <https://access.redhat.com/errata/RHSA-2025:23483>
- <https://access.redhat.com/errata/RHSA-2025:23484>
- <https://access.redhat.com/errata/RHSA-2026:0427>
- <https://access.redhat.com/errata/RHSA-2026:0428>
- <https://access.redhat.com/errata/RHSA-2026:0430>
- <https://access.redhat.com/errata/RHSA-2026:0431>
- <https://access.redhat.com/errata/RHSA-2026:0702>
- <https://access.redhat.com/errata/RHSA-2026:0978>
- <https://access.redhat.com/errata/RHSA-2026:0980>
- <https://access.redhat.com/errata/RHSA-2026:0985>
- <https://access.redhat.com/errata/RHSA-2026:0996>
- <https://access.redhat.com/errata/RHSA-2026:1539>
- <https://access.redhat.com/errata/RHSA-2026:1541>
- <https://access.redhat.com/errata/RHSA-2026:3415>
- <https://access.redhat.com/security/cve/CVE-2025-5987>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2376219>
- <https://www.libssh.org/security/advisories/CVE-2025-5987.txt>
- <https://access.redhat.com/security/updates/classification/#moderate>
- <https://issues.redhat.com/browse/RHEL-135506>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2025/rhsa-2025_23483.json>

---

Data as of 2026-12-05T07:08:27.703Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
