# CVE-2025-5318: Libssh: out-of-bounds read in sftp\_handle()

- Priority: **Routine**
- Reason: Not severe (CVSS 5.4, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-06-24 · Modified: 2026-11-05
- Aliases: RHSA-2025:18231, RHSA-2025:18275, RHSA-2025:18286, RHSA-2025:19012, RHSA-2025:19098, RHSA-2025:19101, RHSA-2025:19400, RHSA-2025:19401, RHSA-2025:19470, RHSA-2025:19472, RHSA-2025:20943, RHSA-2025:21013, UBUNTU-CVE-2025-5318, DEBIAN-CVE-2025-5318, CGA-23vp-82j6-83p3, CGA-4rvc-7hxp-r6pg, CGA-5v9f-8h5p-gmj2, CGA-gqw7-f368-2cwq, ALPINE-CVE-2025-5318
- Record: https://cvemate.com/vulnerability/CVE-2025-5318 · JSON: https://cvemate.com/vulnerability/CVE-2025-5318/json

## Description

```text
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.
```

## Signals

- CVSS: 5.4 medium (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
- EPSS: 2.026%, percentile 81.674%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine libssh (Alpine Linux): \< 0.11.2-r0
- chainguard libssh (Chainguard): \< 0.11.3-r0
- chainguard libssh2 (Chainguard): \< 1.11.1-r1
- wolfi libssh (Wolfi): \< 0.11.3-r0
- wolfi libssh2 (Wolfi): \< 1.11.1-r1
- debian libssh (Debian): \< 0.10.6-0+deb12u2 \| \< 0.11.2-1
- ubuntu libssh (Ubuntu): \< 0.6.3-4.3ubuntu0.6+esm2 \| \< 0.8.0~20170825.94fa1e38-1ubuntu0.7+esm4 \| \< 0.9.3-2ubuntu2.5+esm1 \| \< 0.9.6-2ubuntu0.22.04.4 \| \< 0.10.6-2ubuntu0.1
- libssh libssh: \< 0.11.2
- redhat enterprise\_linux: 8.0 \| 9.0 \| 10.0
- redhat openshift\_container\_platform: 4.0
- redhat libssh (Red Hat): \< 0:0.11.1-4.el10\_0 \| \< 0:0.10.4-15.el9\_6 \| \< 0:0.9.6-15.el8\_10 \| \< 0:0.10.4-13.el9\_4.1 \| \< 0:0.9.6-4.el8\_6.1 \| \< 0:0.9.6-13.el8\_8.1 \| \< 0:0.9.0-4.el8\_2.1 \| \< 0:0.9.4-2.el8\_4.1 \| \< 0:0.10.4-9.el9\_2.1 \| \< 0:0.9.6-3.el9\_0.1 \| \< 0:0.10.4-15.el9\_7 \| \< 0:0.11.1-4.el10\_1
- redhat libssh-config (Red Hat): \< 0:0.11.1-4.el10\_0 \| \< 0:0.10.4-15.el9\_6 \| \< 0:0.9.6-15.el8\_10 \| \< 0:0.10.4-13.el9\_4.1 \| \< 0:0.9.6-4.el8\_6.1 \| \< 0:0.9.6-13.el8\_8.1 \| \< 0:0.9.0-4.el8\_2.1 \| \< 0:0.9.4-2.el8\_4.1 \| \< 0:0.10.4-9.el9\_2.1 \| \< 0:0.9.6-3.el9\_0.1 \| \< 0:0.10.4-15.el9\_7 \| \< 0:0.11.1-4.el10\_1
- redhat libssh-debuginfo (Red Hat): \< 0:0.11.1-4.el10\_0 \| \< 0:0.10.4-15.el9\_6 \| \< 0:0.9.6-15.el8\_10 \| \< 0:0.10.4-13.el9\_4.1 \| \< 0:0.9.6-4.el8\_6.1 \| \< 0:0.9.6-13.el8\_8.1 \| \< 0:0.9.0-4.el8\_2.1 \| \< 0:0.9.4-2.el8\_4.1 \| \< 0:0.10.4-9.el9\_2.1 \| \< 0:0.9.6-3.el9\_0.1 \| \< 0:0.10.4-15.el9\_7 \| \< 0:0.11.1-4.el10\_1
- redhat libssh-debugsource (Red Hat): \< 0:0.11.1-4.el10\_0 \| \< 0:0.10.4-15.el9\_6 \| \< 0:0.9.6-15.el8\_10 \| \< 0:0.10.4-13.el9\_4.1 \| \< 0:0.9.6-4.el8\_6.1 \| \< 0:0.9.6-13.el8\_8.1 \| \< 0:0.9.0-4.el8\_2.1 \| \< 0:0.9.4-2.el8\_4.1 \| \< 0:0.10.4-9.el9\_2.1 \| \< 0:0.9.6-3.el9\_0.1 \| \< 0:0.10.4-15.el9\_7 \| \< 0:0.11.1-4.el10\_1
- redhat libssh-devel (Red Hat): \< 0:0.11.1-4.el10\_0 \| \< 0:0.10.4-15.el9\_6 \| \< 0:0.9.6-15.el8\_10 \| \< 0:0.10.4-13.el9\_4.1 \| \< 0:0.9.6-4.el8\_6.1 \| \< 0:0.9.6-13.el8\_8.1 \| \< 0:0.9.0-4.el8\_2.1 \| \< 0:0.9.4-2.el8\_4.1 \| \< 0:0.10.4-9.el9\_2.1 \| \< 0:0.9.6-3.el9\_0.1 \| \< 0:0.10.4-15.el9\_7 \| \< 0:0.11.1-4.el10\_1

## References (first 20 of 54)

- <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>
- <https://access.redhat.com/errata/RHSA-2025:20943>
- <https://access.redhat.com/errata/RHSA-2025:21013>
- <https://access.redhat.com/errata/RHSA-2025:21329>
- <https://access.redhat.com/errata/RHSA-2025:21829>
- <https://access.redhat.com/errata/RHSA-2025:22275>

---

Data as of 2026-12-05T09:58:27.067Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
