CVEfocus › CVE database › CVE-2025-5318

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

CVSS 5.4 MediumEPSS 1.9% (higher than 80% of CVEs)Published 2025-06-24Updated 2026-11-05Assigner: redhat

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.

CWE-125

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.

Ubuntu has 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

29Fixed
3Fix pending

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-5318
Ubuntu 22.04libsshFixed0.9.6-2ubuntu0.22.04.4UBUNTU-CVE-2025-5318
Ubuntu 20.04libsshFix pending0.9.3-2ubuntu2.5+esm1 (Ubuntu Pro)UBUNTU-CVE-2025-5318
Ubuntu 18.04libsshFix pending0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4 (Ubuntu Pro)UBUNTU-CVE-2025-5318
Ubuntu 16.04libsshFix pending0.6.3-4.3ubuntu0.6+esm2 (Ubuntu Pro)UBUNTU-CVE-2025-5318
Debian 14libsshFixed0.11.2-1DEBIAN-CVE-2025-5318
Debian 13libsshFixed0.11.2-1DEBIAN-CVE-2025-5318
Debian 12libsshFixed0.10.6-0+deb12u2DEBIAN-CVE-2025-5318
Red Hat Enterprise Linux 10libsshFixed0:0.11.1-4.el10_0RHSA-2025:21013
Red Hat Enterprise Linux 10libssh-configFixed0:0.11.1-4.el10_1RHSA-2025:18231
Red Hat Enterprise Linux 10libssh-develFixed0:0.11.1-4.el10_1RHSA-2025:18231
Red Hat Enterprise Linux 9libsshFixed0:0.10.4-15.el9_7RHSA-2025:18275
Red Hat Enterprise Linux 9libssh-configFixed0:0.10.4-15.el9_6RHSA-2025:20943
Red Hat Enterprise Linux 9libssh-develFixed0:0.10.4-15.el9_7RHSA-2025:18275
Red Hat Enterprise Linux 8libsshFixed0:0.9.6-15.el8_10RHSA-2025:18286
Red Hat Enterprise Linux 8libssh-configFixed0:0.9.6-15.el8_10RHSA-2025:18286
Red Hat Enterprise Linux 8libssh-develFixed0:0.9.6-15.el8_10RHSA-2025:18286
AlmaLinux 10libsshFixed0.11.1-4.el10_1ALSA-2025:21013
AlmaLinux 10libssh-configFixed0.11.1-4.el10_0ALSA-2025:21013
AlmaLinux 10libssh-develFixed0.11.1-4.el10_1ALSA-2025:21013
AlmaLinux 9libsshFixed0.10.4-15.el9_6ALSA-2025:20943
AlmaLinux 9libssh-configFixed0.10.4-15.el9_7ALSA-2025:18275
AlmaLinux 9libssh-develFixed0.10.4-15.el9_6ALSA-2025:20943
AlmaLinux 8libsshFixed0.9.6-15.el8_10ALSA-2025:18286
AlmaLinux 8libssh-configFixed0.9.6-15.el8_10ALSA-2025:18286
AlmaLinux 8libssh-develFixed0.9.6-15.el8_10ALSA-2025:18286
Rocky Linux 10libsshFixed0:0.11.1-4.el10_0RLSA-2025:18231
Rocky Linux 9libsshFixed0:0.10.4-15.el9_6RLSA-2025:18275
Rocky Linux 8libsshFixed0:0.9.6-15.el8_10RLSA-2025:18286
Alpine Linux 3.24libsshFixed0.11.2-r0ALPINE-CVE-2025-5318
Alpine Linux 3.23libsshFixed0.11.2-r0ALPINE-CVE-2025-5318
Alpine Linux 3.22libsshFixed0.11.2-r0ALPINE-CVE-2025-5318

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: Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

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.