CVE-2025-5351
libssh: Double Free Vulnerability in libssh Key Export Functions
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · June 24, 2025
Updated · September 1, 2026
Description
A flaw was found in the key export functionality of libssh. The issue occurs in the internal function responsible for converting cryptographic keys into serialized formats. During error handling, a memory structure is freed but not cleared, leading to a potential double free issue if an additional failure occurs later in the function. This condition may result in heap corruption or application instability in low-memory scenarios, posing a risk to system reliability where key export operations are performed.
Statement
The Red Hat Product Security team has rated the severity of this issue as Moderate. The vulnerability arises from a double free condition that is only exploitable under rare and constrained scenarios such as low memory environments. Furthermore, exploitation requires an authenticated user with access to key export functionality, limiting the scope and impact. Despite the restricted preconditions, the flaw still presents a stability concern for services utilizing libssh in sensitive environments.
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
Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability. Administrators should apply vendor-supplied patches as soon as they become available.
CVSS / CWE
CVSS 3.1 · 6.5CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CWE-415 · Double Free