Security Resilience

CVE-2025-5987

Libssh 0.10.0 – 0.11.2

Published
07 July 2025
Modified
23 November 2026
CVSS Score v3.1 8.1
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.017 78th percentile
Risk Priority 63 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). EPSS, Forum of Incident Response and Security Teams (FIRST), epss.first.org. Risk Priority is our own derived reading, not an NVD score.

Summary

CVE-2025-5987 is a high-severity Return of Wrong Status Code (CWE-393) vulnerability in Libssh. Its CVSS base score is 8.1 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Application or System Exploitation (T1499.004); ranked in the top 22% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-6 (Security and Privacy Function Verification) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

A flaw exists in libssh when the ChaCha20 cipher is used together with the OpenSSL library. Heap-exhaustion conditions during cipher initialization are not detected because the OpenSSL error return value aliases with SSH_OK; consequently libssh proceeds with a partially initialized cipher context. The resulting undefined behavior can affect data confidentiality and integrity or cause application crashes. The issue is tracked as CVE-2025-5987 and carries a CVSS 3.1 score of 8.1.

An unauthenticated remote attacker who can reach a libssh-based service and induce heap pressure may trigger the flaw. Successful exploitation can lead to disclosure or manipulation of session data as well as denial-of-service conditions. The attack requires high complexity because the adversary must both control network access and arrange the specific memory-exhaustion state.

Red Hat has published the advisories RHSA-2025:23483, RHSA-2025:23484, RHSA-2026:0427, RHSA-2026:0428 and RHSA-2026:0430 that address the defect; applying the corresponding libssh updates removes the erroneous error-code handling path. The associated EPSS score remains low (current 0.0123, peak 0.0149) with no material upward trajectory after disclosure.

EU & UK References

Vulnerability Data

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.…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

MITRE ATT&CK v20.0

T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
T1557 Adversary-in-the-Middle Credential Access
Adversaries may attempt to position themselves between two or more networked devices using an adversary-in-the-middle (AiTM) technique to support follow-on behaviors such as [Network Sniffing](https://attack.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2025-8114Same product: Libssh Libssh
CVE-2023-3603Same product: Libssh Libssh
CVE-2025-5449Same product: Libssh Libssh
CVE-2026-3731Same product: Libssh Libssh
CVE-2026-0967Same product: Libssh Libssh
CVE-2026-92821Shared CWE-393
CVE-2025-24531Shared CWE-393
CVE-2024-49117Shared CWE-393
CVE-2026-53092Shared CWE-393
CVE-2026-59847Same product: Libssh Libssh

Affected Assets

libssh
libssh
0.10.0 — 0.11.2

Mitigating Controls

Mitigating Controls (NIST 800-53 r5)

Our mappings, made for this CVE.

Developer testing and evaluation at post-design stages directly exercises code paths and can identify functions returning incorrect status codes.

Verification of correct security/privacy function operation will surface incorrect status codes that alter expected behavior.

Mitigating Controls (NIST CSF 2.0)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→CSF cross-walk — links open the control.

PR.PS-06 mostly match
blocks

Secure SDLC practices such as code review, unit testing, and static analysis directly prevent incorrect status codes from being returned.

Mitigating Controls (ISO/IEC 27001:2022 Annex A)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→ISO cross-walk — links open the control.

finds

Security testing in development can detect functions returning wrong status codes.

prevents

Training can make developers more careful about return-value handling and status-code semantics, reducing some instances of this subtle implementation bug, but most occurrences (like the Apple 'goto fail' defect) are accidental code errors that escape review and testing, so training moves only a minority of instances.

prevents

Secure coding standards directly address proper return-value handling and error indication.

finds

A.8.8's disclosure/scanning reach catches CWE-393 only where a vulnerable component already has a published CVE or advisory, while most wrong-status-code defects are first-party implementation logic never disclosed, so it finds a minority of latent instances.

References