libssh Before 3.0 (OpenSSL<3) SSH_KDF Return Value Misinterpretation
CVE-2025-5372 Published on July 4, 2025
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 successthe 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.
Vulnerability Analysis
CVE-2025-5372 is exploitable with network access, and requires small amount of user privileges. This vulnerability is consided to have a high level of attack complexity. The potential impact of an exploit of this vulnerability is considered to be low. considered to have a small impact on confidentiality and integrity and availability.
Timeline
Reported to Red Hat.
Made public. 25 days later.
Weakness Type
Incorrect Calculation
The software performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management. When software performs a security-critical calculation incorrectly, it might lead to incorrect resource allocations, incorrect privilege assignments, or failed comparisons among other things. Many of the direct results of an incorrect calculation can lead to even larger problems such as failed protection mechanisms or even arbitrary code execution.
Products Associated with CVE-2025-5372
You can be notified by email with stack.watch whenever vulnerabilities like CVE-2025-5372 are published in these products:
Affected Versions
libssh:- Before 0.11.2 is affected.
- Version 0:0.9.6-16.el8_10 and below * is unaffected.
- Version 0:0.9.6-16.el8_10 and below * is unaffected.
- Version 0:0.9.6-3.el9_0.2 and below * is unaffected.
Exploit Probability
EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.