CVE-2025-5318Libssh: out-of-bounds read in sftp_handle()
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.
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
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-5318 |
| Ubuntu 22.04 | libssh | Fixed | 0.9.6-2ubuntu0.22.04.4 | UBUNTU-CVE-2025-5318 |
| Ubuntu 20.04 | libssh | Fix pending | 0.9.3-2ubuntu2.5+esm1 (Ubuntu Pro) | UBUNTU-CVE-2025-5318 |
| Ubuntu 18.04 | libssh | Fix pending | 0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4 (Ubuntu Pro) | UBUNTU-CVE-2025-5318 |
| Ubuntu 16.04 | libssh | Fix pending | 0.6.3-4.3ubuntu0.6+esm2 (Ubuntu Pro) | UBUNTU-CVE-2025-5318 |
| Debian 14 | libssh | Fixed | 0.11.2-1 | DEBIAN-CVE-2025-5318 |
| Debian 13 | libssh | Fixed | 0.11.2-1 | DEBIAN-CVE-2025-5318 |
| Debian 12 | libssh | Fixed | 0.10.6-0+deb12u2 | DEBIAN-CVE-2025-5318 |
| Red Hat Enterprise Linux 10 | libssh | Fixed | 0:0.11.1-4.el10_0 | RHSA-2025:21013 |
| Red Hat Enterprise Linux 10 | libssh-config | Fixed | 0:0.11.1-4.el10_1 | RHSA-2025:18231 |
| Red Hat Enterprise Linux 10 | libssh-devel | Fixed | 0:0.11.1-4.el10_1 | RHSA-2025:18231 |
| Red Hat Enterprise Linux 9 | libssh | Fixed | 0:0.10.4-15.el9_7 | RHSA-2025:18275 |
| Red Hat Enterprise Linux 9 | libssh-config | Fixed | 0:0.10.4-15.el9_6 | RHSA-2025:20943 |
| Red Hat Enterprise Linux 9 | libssh-devel | Fixed | 0:0.10.4-15.el9_7 | RHSA-2025:18275 |
| Red Hat Enterprise Linux 8 | libssh | Fixed | 0:0.9.6-15.el8_10 | RHSA-2025:18286 |
| Red Hat Enterprise Linux 8 | libssh-config | Fixed | 0:0.9.6-15.el8_10 | RHSA-2025:18286 |
| Red Hat Enterprise Linux 8 | libssh-devel | Fixed | 0:0.9.6-15.el8_10 | RHSA-2025:18286 |
| AlmaLinux 10 | libssh | Fixed | 0.11.1-4.el10_1 | ALSA-2025:21013 |
| AlmaLinux 10 | libssh-config | Fixed | 0.11.1-4.el10_0 | ALSA-2025:21013 |
| AlmaLinux 10 | libssh-devel | Fixed | 0.11.1-4.el10_1 | ALSA-2025:21013 |
| AlmaLinux 9 | libssh | Fixed | 0.10.4-15.el9_6 | ALSA-2025:20943 |
| AlmaLinux 9 | libssh-config | Fixed | 0.10.4-15.el9_7 | ALSA-2025:18275 |
| AlmaLinux 9 | libssh-devel | Fixed | 0.10.4-15.el9_6 | ALSA-2025:20943 |
| AlmaLinux 8 | libssh | Fixed | 0.9.6-15.el8_10 | ALSA-2025:18286 |
| AlmaLinux 8 | libssh-config | Fixed | 0.9.6-15.el8_10 | ALSA-2025:18286 |
| AlmaLinux 8 | libssh-devel | Fixed | 0.9.6-15.el8_10 | ALSA-2025:18286 |
| Rocky Linux 10 | libssh | Fixed | 0:0.11.1-4.el10_0 | RLSA-2025:18231 |
| Rocky Linux 9 | libssh | Fixed | 0:0.10.4-15.el9_6 | RLSA-2025:18275 |
| Rocky Linux 8 | libssh | Fixed | 0:0.9.6-15.el8_10 | RLSA-2025:18286 |
| Alpine Linux 3.24 | libssh | Fixed | 0.11.2-r0 | ALPINE-CVE-2025-5318 |
| Alpine Linux 3.23 | libssh | Fixed | 0.11.2-r0 | ALPINE-CVE-2025-5318 |
| Alpine Linux 3.22 | libssh | Fixed | 0.11.2-r0 | ALPINE-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.
- libssh: affected: before 0.11.2; fixed in
0.11.2 - Red Hat Enterprise Linux 10
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 8.2 Advanced Update Support
- 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 Telecommunications Update Service
- Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions
- 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
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:
- https://access.redhat.com/errata/RHSA-2025:18231 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2025:18275 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2025:18286 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2025:19012 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2025:19098 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2025:19101 (vendor-advisory)
References
- https://access.redhat.com/errata/RHSA-2025:18231
- https://access.redhat.com/errata/RHSA-2025:18275
- https://access.redhat.com/errata/RHSA-2025:18286
- https://access.redhat.com/errata/RHSA-2025:19012
- https://access.redhat.com/errata/RHSA-2025:19098
- https://access.redhat.com/errata/RHSA-2025:19101
- https://access.redhat.com/errata/RHSA-2025:19295
- https://access.redhat.com/errata/RHSA-2025:19300
- https://access.redhat.com/errata/RHSA-2025:19313
- https://access.redhat.com/errata/RHSA-2025:19400
- https://access.redhat.com/errata/RHSA-2025:19401
- https://access.redhat.com/errata/RHSA-2025:19470
- https://access.redhat.com/errata/RHSA-2025:19472
- https://access.redhat.com/errata/RHSA-2025:19807
- https://access.redhat.com/errata/RHSA-2025:19864
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.