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.
Security readout for executives and security teams
Plain-English summary
A libssh error-handling flaw can treat failed SSH key derivation as successful, allowing uninitialized cryptographic keys to protect later communications. Under the required conditions, this could weaken session confidentiality, integrity, or availability. The supplied CVSS score is 5.0, reflecting meaningful but constrained risk.
Executive priority
Treat as a scheduled, risk-based remediation rather than an emergency incident unless affected libssh is exposed in critical services. Quickly inventory relevant Red Hat and OpenShift estates, apply applicable vendor updates, and escalate systems handling sensitive SSH traffic or essential operations.
Technical view
In libssh builds using OpenSSL older than 3.0, ssh_kdf() can misinterpret OpenSSL’s failure return value as libssh success. Subsequent communication may use uninitialized key buffers. The CVSS vector indicates network reachability, high attack complexity, low privileges, no user interaction, and limited impact across confidentiality, integrity, and availability.
Likely exposure
Prioritize systems using libssh built with OpenSSL older than 3.0. The bundle identifies affected RHEL 8, RHEL 9, selected extended-support streams, and OpenShift 4 components. RHEL 10 is listed unaffected. RHEL 6 and 7 libssh2 status is unknown and should not be assumed affected.
Exploitation context
The supplied record is not in KEV and provides no evidence of active exploitation. Exploitation is constrained by high complexity and a low-privilege requirement. Exact triggering conditions and practical reliability are not established in the bundle, so exposure should be assessed without assuming routine exploitation.
Researcher notes
The defect is return-code semantic confusion classified as CWE-682. Analysis should focus on the key-derivation failure path and whether uninitialized buffers reach session cryptographic state. The bundle does not establish exploit availability, observed attacks, exact failure triggers, or complete fixed-version boundaries; consult the linked vendor advisories for package-specific resolution.
Mitigation direction
Inventory libssh packages, linked applications, and their OpenSSL build versions.
Apply the applicable Red Hat security update for each affected supported product stream.
Prioritize externally reachable or business-critical services that depend on affected libssh builds.
Check vendor guidance for products or package versions not explicitly resolved by the supplied record.
Validation and detection
Confirm installed libssh package versions against the applicable Red Hat advisory.
Verify whether each libssh build uses an OpenSSL version older than 3.0.
Retest dependent SSH services after updating, including connection and authentication workflows.
Document RHEL 6 and 7 libssh2 findings separately because their status remains unknown.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
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.