Vulnerability · Published Jul 4, 2025 · Assigned by redhat
CVE-2025-5372Libssh: incorrect return code handling in ssh_kdf() in libssh
Medium 5.0
In plain English
A medium-severity security flaw in libssh from libssh. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 43% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | libssh | 0.9.6-16.el8_10 | ALSA-2025:21977 |
| AlmaLinux:8 | libssh-config | 0.9.6-16.el8_10 | ALSA-2025:21977 |
| AlmaLinux:8 | libssh-devel | 0.9.6-16.el8_10 | ALSA-2025:21977 |
| Alpine:v3.22 | libssh | 0.11.2-r0 | ALPINE-CVE-2025-5372 |
| Alpine:v3.23 | libssh | 0.11.2-r0 | ALPINE-CVE-2025-5372 |
| Alpine:v3.24 | libssh | 0.11.2-r0 | ALPINE-CVE-2025-5372 |
| Debian:12 | libssh | 0.10.6-0+deb12u2 | DEBIAN-CVE-2025-5372 |
| Debian:13 | libssh | 0.11.2-1 | DEBIAN-CVE-2025-5372 |
| Debian:14 | libssh | 0.11.2-1 | DEBIAN-CVE-2025-5372 |
| Rocky Linux:8 | libssh | 0:0.9.6-16.el8_10 | RLSA-2025:21977 |
| Ubuntu:22.04:LTS | libssh | 0.9.6-2ubuntu0.22.04.4 | USN-7619-1 |
| Ubuntu:22.04:LTS | libssh | 0.9.6-2ubuntu0.22.04.4 | UBUNTU-CVE-2025-5372 |
| Ubuntu:24.04:LTS | libssh | 0.10.6-2ubuntu0.1 | USN-7619-1 |
| Ubuntu:24.04:LTS | libssh | 0.10.6-2ubuntu0.1 | UBUNTU-CVE-2025-5372 |
Affected products (as reported)
Weakness: CWE-682 · Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
References
- RHSA-2025:21977 vendor-advisory, x_refsource_REDHAT
- RHSA-2025:23024 vendor-advisory, x_refsource_REDHAT
- RHSA-2026:20610 vendor-advisory, x_refsource_REDHAT
- RHSA-2026:24349 vendor-advisory, x_refsource_REDHAT
- RHSA-2026:25911 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2025-5372 vdb-entry, x_refsource_REDHAT
- RHBZ#2369388 issue-tracking, x_refsource_REDHAT