CVEfocus › CVE database › CVE-2025-5372

CVE-2025-5372Libssh: incorrect return code handling in ssh_kdf() in libssh

CVSS 5.0 MediumEPSS 0.5% (higher than 44% of CVEs)Published 2025-07-04Updated 2026-11-24Assigner: redhat

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.

CWE-682

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, Ubuntu have 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

15Fixed
6Fix pending
6Will not fix
3Not 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-5372
Ubuntu 22.04libsshFixed0.9.6-2ubuntu0.22.04.4UBUNTU-CVE-2025-5372
Ubuntu 20.04libsshFix pendingUBUNTU-CVE-2025-5372
Ubuntu 18.04libsshFix pendingUBUNTU-CVE-2025-5372
Ubuntu 16.04libsshFix pendingUBUNTU-CVE-2025-5372
Debian 14libsshFixed0.11.2-1DEBIAN-CVE-2025-5372
Debian 13libsshFixed0.11.2-1DEBIAN-CVE-2025-5372
Debian 12libsshFixed0.10.6-0+deb12u2DEBIAN-CVE-2025-5372
Red Hat Enterprise Linux 10libsshNot affected
Red Hat Enterprise Linux 10libssh-configNot affected
Red Hat Enterprise Linux 10libssh-develNot affected
Red Hat Enterprise Linux 9libsshFix pending
Affected
Red Hat Enterprise Linux 9libssh-configFix pending
Affected
Red Hat Enterprise Linux 9libssh-develFix pending
Affected
Red Hat Enterprise Linux 8libsshFixed0:0.9.6-16.el8_10RHSA-2025:21977
Red Hat Enterprise Linux 8libssh-configFixed0:0.9.6-16.el8_10RHSA-2025:21977
Red Hat Enterprise Linux 8libssh-develFixed0:0.9.6-16.el8_10RHSA-2025:21977
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 8libsshFixed0.9.6-16.el8_10ALSA-2025:21977
AlmaLinux 8libssh-configFixed0.9.6-16.el8_10ALSA-2025:21977
AlmaLinux 8libssh-develFixed0.9.6-16.el8_10ALSA-2025:21977
Rocky Linux 8libsshFixed0:0.9.6-16.el8_10RLSA-2025:21977
Alpine Linux 3.24libsshFixed0.11.2-r0ALPINE-CVE-2025-5372
Alpine Linux 3.23libsshFixed0.11.2-r0ALPINE-CVE-2025-5372
Alpine Linux 3.22libsshFixed0.11.2-r0ALPINE-CVE-2025-5372

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

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.