CVE Database›Document archive›CVE-2025-5372

CVE-2025-5372

libssh: Incorrect Return Code Handling in ssh_kdf() in libssh

Loading…

Severity

Moderate

Red Hat Product Security

5

CVSS 3.1

Review impact separately from score.

Published · June 24, 2025

Updated · September 1, 2026

Description

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.

Statement

The Red Hat Product Security team has assessed the severity of this vulnerability as Moderate due to the combination of limited prerequisites and its impact on confidentiality, integrity, and availability. The vulnerability is only present when libssh is built with OpenSSL versions older than 3.0. Successful exploitation could allow an attacker to initiate cryptographic operations using uninitialized keys, which may compromise secure SSH sessions.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

To mitigate this issue, administrators should ensure that libssh is built against OpenSSL version 3.0 or later. This change eliminates the return code mismatch and prevents the erroneous use of uninitialized key material. It is also strongly recommended to apply vendor supplied patches or update to the latest libssh security release as soon as possible.

CVSS / CWE

CVSS 3.1 · 5
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L

CWE-682 · Incorrect Calculation