CVE-2025-5372Libssh: incorrect return code handling in ssh_kdf() in libssh
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.
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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | libssh | Fixed | 0.10.6-2ubuntu0.1 | UBUNTU-CVE-2025-5372 |
| Ubuntu 22.04 | libssh | Fixed | 0.9.6-2ubuntu0.22.04.4 | UBUNTU-CVE-2025-5372 |
| Ubuntu 20.04 | libssh | Fix pending | UBUNTU-CVE-2025-5372 | |
| Ubuntu 18.04 | libssh | Fix pending | UBUNTU-CVE-2025-5372 | |
| Ubuntu 16.04 | libssh | Fix pending | UBUNTU-CVE-2025-5372 | |
| Debian 14 | libssh | Fixed | 0.11.2-1 | DEBIAN-CVE-2025-5372 |
| Debian 13 | libssh | Fixed | 0.11.2-1 | DEBIAN-CVE-2025-5372 |
| Debian 12 | libssh | Fixed | 0.10.6-0+deb12u2 | DEBIAN-CVE-2025-5372 |
| Red Hat Enterprise Linux 10 | libssh | Not affected | ||
| Red Hat Enterprise Linux 10 | libssh-config | Not affected | ||
| Red Hat Enterprise Linux 10 | libssh-devel | Not affected | ||
| Red Hat Enterprise Linux 9 | libssh | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | libssh-config | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | libssh-devel | Fix pending Affected | ||
| Red Hat Enterprise Linux 8 | libssh | Fixed | 0:0.9.6-16.el8_10 | RHSA-2025:21977 |
| Red Hat Enterprise Linux 8 | libssh-config | Fixed | 0:0.9.6-16.el8_10 | RHSA-2025:21977 |
| Red Hat Enterprise Linux 8 | libssh-devel | Fixed | 0:0.9.6-16.el8_10 | RHSA-2025:21977 |
| Red Hat Enterprise Linux 7 | libssh2 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | libssh2-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | libssh2-docs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | libssh2 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | libssh2-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | libssh2-docs | Will not fix Out of support scope | ||
| AlmaLinux 8 | libssh | Fixed | 0.9.6-16.el8_10 | ALSA-2025:21977 |
| AlmaLinux 8 | libssh-config | Fixed | 0.9.6-16.el8_10 | ALSA-2025:21977 |
| AlmaLinux 8 | libssh-devel | Fixed | 0.9.6-16.el8_10 | ALSA-2025:21977 |
| Rocky Linux 8 | libssh | Fixed | 0:0.9.6-16.el8_10 | RLSA-2025:21977 |
| Alpine Linux 3.24 | libssh | Fixed | 0.11.2-r0 | ALPINE-CVE-2025-5372 |
| Alpine Linux 3.23 | libssh | Fixed | 0.11.2-r0 | ALPINE-CVE-2025-5372 |
| Alpine Linux 3.22 | libssh | Fixed | 0.11.2-r0 | ALPINE-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.
- libssh: affected: before 0.11.2; fixed in
0.11.2 - Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support
- Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On
- Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support
- Red Hat Enterprise Linux 8.6 Extended Update Support Long-Life Add-On
- Red Hat Enterprise Linux 8.8 Telecommunications Update Service
- Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions
- Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions
- Red Hat Enterprise Linux 10
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
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:
- https://access.redhat.com/errata/RHSA-2025:21977 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2025:23024 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2026:20610 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2026:24349 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2026:25911 (vendor-advisory)
References
- https://access.redhat.com/errata/RHSA-2025:21977
- https://access.redhat.com/errata/RHSA-2025:23024
- https://access.redhat.com/errata/RHSA-2026:20610
- https://access.redhat.com/errata/RHSA-2026:24349
- https://access.redhat.com/errata/RHSA-2026:25911
- https://access.redhat.com/security/cve/CVE-2025-5372
- https://bugzilla.redhat.com/show_bug.cgi?id=2369388
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.