CVE-2025-5372

Libssh: incorrect return code handling in ssh_kdf() in libssh

5.0 medium EPSS 0.98%

Published 4 Jul 2025 Updated 26 Nov 2026 CNA: redhat

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.

Severity (CVSS)

5.0 medium CVSS 3.1 from redhat (CNA)
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality low, integrity low, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.98%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 61.1% of all scored CVEs. Scores of 26 Nov 2026.

The assessment of CISA (SSVC, 8 Jul 2025):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Weakness

Affected products

As the CNA lists them.

ProductVersions
libssh
package libssh
affected before 0.11.2
Other versions: unaffected
Red Hat Enterprise Linux 8
package libssh
unaffected 0:0.9.6-16.el8_10 and later
Other versions: affected
Red Hat Enterprise Linux 8
package libssh
unaffected 0:0.9.6-16.el8_10 and later
Other versions: affected
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support
package libssh
unaffected 0:0.9.4-2.el8_4.2 and later
Other versions: affected
Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On
package libssh
unaffected 0:0.9.4-2.el8_4.2 and later
Other versions: affected
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support
package libssh
unaffected 0:0.9.6-4.el8_6.2 and later
Other versions: affected
Red Hat Enterprise Linux 8.6 Extended Update Support Long-Life Add-On
package libssh
unaffected 0:0.9.6-4.el8_6.2 and later
Other versions: affected
Red Hat Enterprise Linux 8.8 Telecommunications Update Service
package libssh
unaffected 0:0.9.6-13.el8_8.2 and later
Other versions: affected
Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions
package libssh
unaffected 0:0.9.6-13.el8_8.2 and later
Other versions: affected
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions
package libssh
unaffected 0:0.9.6-3.el9_0.2 and later
Other versions: affected
Red Hat Enterprise Linux 10
package libssh
unaffected the record does not list versions
Red Hat Enterprise Linux 6
package libssh2
unknown the record does not list versions
Red Hat Enterprise Linux 7
package libssh2
unknown the record does not list versions
Red Hat Enterprise Linux 9
package libssh
affected the record does not list versions
Red Hat OpenShift Container Platform 4
package openshift/ose-rhel-coreos-8
affected the record does not list versions
Red Hat OpenShift Container Platform 4
package openshift/ose-rhel-coreos-9
unaffected the record does not list versions

Is my server affected?

Find the installed version of libssh and compare it with the fixed version of your distribution. Distributions often fix a CVE in their own package version, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i libssh
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2025-5372 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2025-5372

RHEL, Rocky, Alma, Fedora

rpm -q libssh
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2025-5372

Alpine

apk list --installed | grep -i libssh

With Trivy, on the host and for a container image; it prints the installed and the fixed version when a package is affected:

trivy rootfs --scanners vuln / | grep CVE-2025-5372
trivy image --scanners vuln IMAGE | grep CVE-2025-5372

Patchbrief matches the package lists of your Linux servers and containers every day against the Trivy vulnerability database, which covers the packages of Linux distributions and language packages (npm, PyPI, Go, Maven and others), and sends one digest with the command that fixes each problem. Install the agent.

References

Advisories

Source: the record CVE-2025-5372 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.