CVEfocus › CVE database › CVE-2025-5351

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

CVSS 6.5 MediumEPSS 1.2% (higher than 68% of CVEs)Published 2025-07-04Updated 2026-11-24Assigner: redhat

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.

CWE-415

What to do

Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Red Hat has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

14Fixed
6Fix pending
6Will not fix
1Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04libsshFixed0.10.6-2ubuntu0.1UBUNTU-CVE-2025-5351
Ubuntu 22.04libsshNot affected
vulnerable_code_not_present
Debian 14libsshFixed0.11.2-1DEBIAN-CVE-2025-5351
Debian 13libsshFixed0.11.2-1DEBIAN-CVE-2025-5351
Debian 12libsshFixed0.10.6-0+deb12u2DEBIAN-CVE-2025-5351
Red Hat Enterprise Linux 10libsshFix pending
Fix deferred
Red Hat Enterprise Linux 10libssh-configFix pending
Fix deferred
Red Hat Enterprise Linux 10libssh-develFix pending
Fix deferred
Red Hat Enterprise Linux 9libsshFixed0:0.10.4-18.el9RHSA-2026:18683
Red Hat Enterprise Linux 9libssh-configFixed0:0.10.4-18.el9RHSA-2026:18683
Red Hat Enterprise Linux 9libssh-develFixed0:0.10.4-18.el9RHSA-2026:18683
Red Hat Enterprise Linux 8libsshFix pending
Fix deferred
Red Hat Enterprise Linux 8libssh-configFix pending
Fix deferred
Red Hat Enterprise Linux 8libssh-develFix pending
Fix deferred
Red Hat Enterprise Linux 7libssh2Will not fix
Out of support scope
Red Hat Enterprise Linux 7libssh2-develWill not fix
Out of support scope
Red Hat Enterprise Linux 7libssh2-docsWill not fix
Out of support scope
Red Hat Enterprise Linux 6libssh2Will not fix
Out of support scope
Red Hat Enterprise Linux 6libssh2-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6libssh2-docsWill not fix
Out of support scope
AlmaLinux 9libsshFixed0.10.4-18.el9ALSA-2026:18683
AlmaLinux 9libssh-configFixed0.10.4-18.el9ALSA-2026:18683
AlmaLinux 9libssh-develFixed0.10.4-18.el9ALSA-2026:18683
Rocky Linux 9libsshFixed0:0.10.4-18.el9RLSA-2026:18683
Alpine Linux 3.24libsshFixed0.11.2-r0ALPINE-CVE-2025-5351
Alpine Linux 3.23libsshFixed0.11.2-r0ALPINE-CVE-2025-5351
Alpine Linux 3.22libsshFixed0.11.2-r0ALPINE-CVE-2025-5351

What the vendor says

As published in the CVE record by redhat, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Workaround: 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.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.