CVE-2025-5351 | Libssh: double free vulnerability in libssh key export functions

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.

Published: 2025-07-04 Last update: 2026-05-19 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2025-5351 is rated Moderate Risk (49/100): CVSS Medium severity, with medium exploitation likelihood (EPSS 0.48%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2025-5351

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-05-23 0.34% 0.48% +0.15%
2 2026-05-20 0.35% 0.34% -0.02%
3 2026-04-30 0.35%

Full EPSS history (5 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2025-5351

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
6.5 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 3.6 [email protected]
6.5 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 3.6 [email protected]

Weakness enumeration for CVE-2025-5351

GitHub Security Advisory for CVE-2025-5351

GHSA-pfqf-mv4p-9j4r · Severity: medium — A flaw was found in the key export functionality of libssh. The issue occurs in the internal...

OS Trackers for CVE-2025-5351

vendor priority summary link
alpine CVE-2025-5351: 1 source package rows (libssh); 6 state rows across 2 repos (3.22-community, edge-community); fixed 2, open 4. https://security.alpinelinux.org/vuln/CVE-2025-5351
debian unimportant CVE-2025-5351 unimportant priority: Debian including 1 source packages (libssh), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2025-5351
redhat medium https://access.redhat.com/security/cve/CVE-2025-5351
suse medium CVE-2025-5351 severity moderate: SUSE including 256 source package names (2.2.1-5.14:libssh-config-0.10.6-slfo.1.1_2.1, 2.2.1-5.14:libssh4-0.10.6-slfo.1.1_2.1, …), 459 product×package rows across 78 product lines (Container suse/sl-micro/6.1/baremetal-os-container, Container suse/sl-micro/6.1/base-os-container, … (78 product lines)): Known Affected 231, Known Not Affected 135, Fixed 93. https://www.suse.com/security/cve/CVE-2025-5351/
ubuntu medium CVE-2025-5351 medium priority: Ubuntu including 1 source packages (libssh), 8 status rows across 8 suites (bionic, focal, jammy, noble, oracular, plucky, upstream, xenial): not-affected 4, released 4. https://ubuntu.com/security/CVE-2025-5351

Affected software / configurations for CVE-2025-5351

Vendor Product Version Raw CPE
libssh libssh >= 0.10.0, < 0.11.2 cpe:2.3:a:libssh:libssh:*:*:*:*:*:*:*:*
redhat openshift_container_platform 4.0 cpe:2.3:a:redhat:openshift_container_platform:4.0:*:*:*:*:*:*:*
redhat enterprise_linux 6.0 cpe:2.3:o:redhat:enterprise_linux:6.0:*:*:*:*:*:*:*
redhat enterprise_linux 7.0 cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*
redhat enterprise_linux 8.0 cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*
redhat enterprise_linux 9.0 cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*
redhat enterprise_linux 10.0 cpe:2.3:o:redhat:enterprise_linux:10.0:*:*:*:*:*:*:*

References for CVE-2025-5351

cvelogic Threat Intelligence