Vulnerability · Published Jun 24, 2025 · Assigned by redhat

CVE-2025-5318Libssh: out-of-bounds read in sftp_handle()

Medium 5.4

In plain English

A medium-severity out-of-bounds read in libssh. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.9% (higher than 80% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.4Medium
Exploit odds (30 days)1.9%top 20.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

A flaw was found in the libssh library in versions less than 0.11.2. An out-of-bounds read can be triggered in the sftp_handle function due to an incorrect comparison check that permits the function to access memory beyond the valid handle list and to return an invalid pointer, which is used in further processing. This vulnerability allows an authenticated remote attacker to potentially read unintended memory regions, exposing sensitive information or affect service behavior.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:10libssh0.11.1-4.el10_1ALSA-2025:21013
AlmaLinux:8libssh0.9.6-15.el8_10ALSA-2025:18286
AlmaLinux:9libssh0.10.4-15.el9_7ALSA-2025:20943
AlmaLinux:9libssh0.10.4-15.el9_6ALSA-2025:18275
AlmaLinux:10libssh-config0.11.1-4.el10_1ALSA-2025:21013
AlmaLinux:10libssh-config0.11.1-4.el10_0ALSA-2025:18231
AlmaLinux:8libssh-config0.9.6-15.el8_10ALSA-2025:18286
AlmaLinux:9libssh-config0.10.4-15.el9_6ALSA-2025:18275
AlmaLinux:9libssh-config0.10.4-15.el9_7ALSA-2025:20943
AlmaLinux:10libssh-devel0.11.1-4.el10_1ALSA-2025:21013
AlmaLinux:8libssh-devel0.9.6-15.el8_10ALSA-2025:18286
AlmaLinux:9libssh-devel0.10.4-15.el9_7ALSA-2025:20943
AlmaLinux:9libssh-devel0.10.4-15.el9_6ALSA-2025:18275
Alpine:v3.22libssh0.11.2-r0ALPINE-CVE-2025-5318
Alpine:v3.23libssh0.11.2-r0ALPINE-CVE-2025-5318
Alpine:v3.24libssh0.11.2-r0ALPINE-CVE-2025-5318
Debian:12libssh0.10.6-0+deb12u2DEBIAN-CVE-2025-5318
Debian:13libssh0.11.2-1DEBIAN-CVE-2025-5318
Debian:14libssh0.11.2-1DEBIAN-CVE-2025-5318
Rocky Linux:10libssh0:0.11.1-4.el10_0RLSA-2025:18231
Rocky Linux:8libssh0:0.9.6-15.el8_10RLSA-2025:18286
Rocky Linux:9libssh0:0.10.4-15.el9_6RLSA-2025:20943
Rocky Linux:9libssh0:0.10.4-15.el9_6RLSA-2025:18275
Ubuntu:22.04:LTSlibssh0.9.6-2ubuntu0.22.04.4USN-7619-1
Ubuntu:22.04:LTSlibssh0.9.6-2ubuntu0.22.04.4UBUNTU-CVE-2025-5318
Ubuntu:24.04:LTSlibssh0.10.6-2ubuntu0.1UBUNTU-CVE-2025-5318
Ubuntu:24.04:LTSlibssh0.10.6-2ubuntu0.1USN-7619-1

Affected products (as reported)

VendorProductVersions
libssh 0 – before 0.11.2
Red Hat Red Hat Enterprise Linux 10 see references
Red Hat Red Hat Enterprise Linux 10 see references
Red Hat Red Hat Enterprise Linux 8 see references
Red Hat Red Hat Enterprise Linux 8 see references
Red Hat Red Hat Enterprise Linux 8.2 Advanced Update Support see references
Red Hat Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support see references
Red Hat Red Hat Enterprise Linux 8.4 Extended Update Support Long-Life Add-On see references
Red Hat Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support see references
Red Hat Red Hat Enterprise Linux 8.6 Telecommunications Update Service see references
Red Hat Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions see references
Red Hat Red Hat Enterprise Linux 8.8 Telecommunications Update Service see references
Red Hat Red Hat Enterprise Linux 8.8 Update Services for SAP Solutions see references
Red Hat Red Hat Enterprise Linux 9 see references
Red Hat Red Hat Enterprise Linux 9 see references
Red Hat Red Hat Enterprise Linux 9 see references
Red Hat Red Hat Enterprise Linux 9 see references
Red Hat Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions see references
Red Hat Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions see references
Red Hat Red Hat Enterprise Linux 9.4 Extended Update Support see references
Red Hat Red Hat OpenShift Container Platform 4.12 see references
Red Hat Red Hat OpenShift Container Platform 4.13 see references
Red Hat Red Hat OpenShift Container Platform 4.14 see references
Red Hat Red Hat OpenShift Container Platform 4.15 see references
Red Hat Red Hat OpenShift Container Platform 4.16 see references
Red Hat Red Hat OpenShift Container Platform 4.17 see references
Red Hat Red Hat OpenShift Container Platform 4.18 see references
Red Hat Red Hat OpenShift Container Platform 4.19 see references
Red Hat Red Hat OpenShift Container Platform 4.20 see references
Red Hat Red Hat AI Inference Server 3.2 see references

Weakness: CWE-125 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N

References