CVE-2025-5372: Libssh: incorrect return code handling in ssh_kdf() in libssh
A flaw was found in libssh versions built with OpenSSL versions older than 3.0, specifically in the ssh_kdf() function responsible for key derivation. Due to inconsistent interpretation of return values where OpenSSL uses 0 to indicate failure and libssh uses 0 for success—the function may mistakenly return a success status even when key derivation fails. This results in uninitialized cryptographic key buffers being used in subsequent communication, potentially compromising SSH sessions' confidentiality, integrity, and availability.
CVE-2025-5372 is a libssh cryptographic error-handling flaw. In affected builds, a failed key-derivation operation may be treated as successful, causing SSH sessions to use uninitialized keys. That can weaken confidentiality, integrity, and availability, but the published severity is medium and exploitation is not reported in the provided sources.
Executive priority
Treat as a scheduled security update, not an emergency, unless libssh is used in sensitive SSH workflows. Prioritize Red Hat systems explicitly listed as affected and OpenShift environments. The business risk is possible weakening of SSH session protections, with no active exploitation reported in the provided sources.
Technical view
In libssh built with OpenSSL versions older than 3.0, ssh_kdf() may misinterpret return codes: OpenSSL uses 0 for failure, while libssh uses 0 for success. This can lead to uninitialized cryptographic key buffers in subsequent SSH communication. CVSS v3.1 is 5.0: network vector, high complexity, low privileges, no user interaction.
Likely exposure
Exposure is most relevant to Red Hat-listed libssh packages in RHEL 8, RHEL 9, certain extended support streams, and OpenShift Container Platform 4/RHCOS. RHEL 10 is listed unaffected. RHEL 6 and 7 libssh2 status is unknown in the provided data. Non-Red Hat exposure is not established here.
Exploitation context
The source bundle marks KEV as false, and no cited source states active exploitation. The vulnerability is remotely reachable in principle, but rated high complexity and requiring low privileges. Public sources provided do not include exploit details or operational proof of exploitation.
Researcher notes
Key evidence comes from the CVE description and Red Hat affected-product data. The core issue is inconsistent return-code semantics in ssh_kdf(). The bundle does not provide upstream patch details, exploitability research, or non-Red Hat affected-version ranges, so avoid broad ecosystem claims without additional vendor confirmation.
Mitigation direction
Apply relevant Red Hat RHSA updates for affected platforms.
Review OpenShift/RHCOS update guidance for OpenShift 4 clusters.
Prioritize systems using libssh for sensitive or exposed SSH services.
For non-Red Hat builds, check vendor libssh guidance.
Track RHEL 6/7 libssh2 status separately; source marks unknown.
Validation and detection
Inventory installed libssh packages and versions.
Map hosts to affected Red Hat products and streams.
Check whether libssh uses OpenSSL older than 3.0.
Confirm RHSA-listed updates are installed where applicable.
Identify applications that embed or dynamically link libssh.
Based on public source material and reviewed before publication.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-682: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The affected technology mentions containers, so container-specific ATT&CK technique review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve
time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present,
the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-682 · source CWE mapping
Incorrect Calculation
Incorrect Calculation represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.