CVE-2025-5318 | Libssh: 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.

Published: 2025-06-24 Last update: 2026-02-27 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2025-5318 is rated Moderate Risk (45.9/100): CVSS High severity, with low exploitation likelihood (EPSS 0.18%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2025-5318

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-05-22 0.30% 0.18% -0.13%
2 2026-04-20 0.07% 0.30% +0.23%
3 2026-01-22 0.07%

Full EPSS history (11 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2025-5318

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
8.1 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 5.2 [email protected]
8.1 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 5.2 [email protected]

Weakness enumeration for CVE-2025-5318

OS Trackers for CVE-2025-5318

vendor priority summary link
alpine CVE-2025-5318: 1 source package rows (libssh); 2 state rows across 2 repos (3.22-community, edge-community); fixed 2, open 0. https://security.alpinelinux.org/vuln/CVE-2025-5318
debian not yet assigned CVE-2025-5318 not yet assigned priority: Debian including 1 source packages (libssh), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2025-5318
redhat medium https://access.redhat.com/security/cve/CVE-2025-5318
suse medium CVE-2025-5318 severity moderate: SUSE including 361 source package names (0.0.17-1.1:libssh-config-0.9.8-150600.11.3.1, 0.0.17-1.1:libssh4-0.9.8-150600.11.3.1, …), 1060 product×package rows across 367 product lines (Container bci/kiwi, Container bci/spack, … (367 product lines)): Fixed 839, Known Affected 221. https://www.suse.com/security/cve/CVE-2025-5318/
ubuntu medium CVE-2025-5318 medium priority: Ubuntu including 1 source packages (libssh), 8 status rows across 8 suites (bionic, focal, jammy, noble, oracular, plucky, upstream, xenial): released 8. https://ubuntu.com/security/CVE-2025-5318

Affected software / configurations for CVE-2025-5318

Vendor Product Version Raw CPE
redhat openshift_container_platform 4.0 cpe:2.3:a:redhat:openshift_container_platform:4.0:*:*:*:*:*:*:*
redhat enterprise_linux 8.0 cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*
redhat enterprise_linux 9.0 cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*
redhat enterprise_linux 10.0 cpe:2.3:o:redhat:enterprise_linux:10.0:*:*:*:*:*:*:*
libssh libssh < 0.11.2 cpe:2.3:a:libssh:libssh:*:*:*:*:*:*:*:*

References for CVE-2025-5318

URL Tags
https://access.redhat.com/errata/RHSA-2025:18231 Third Party Advisory
https://access.redhat.com/errata/RHSA-2025:18275 Third Party Advisory
https://access.redhat.com/errata/RHSA-2025:18286 Third Party Advisory
https://access.redhat.com/errata/RHSA-2025:19012 Third Party Advisory
https://access.redhat.com/errata/RHSA-2025:19098 Third Party Advisory
https://access.redhat.com/errata/RHSA-2025:19101 Third Party Advisory
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
https://access.redhat.com/errata/RHSA-2025:23078
https://access.redhat.com/errata/RHSA-2025:23079
https://access.redhat.com/errata/RHSA-2025:23080
https://access.redhat.com/errata/RHSA-2026:0326
https://access.redhat.com/errata/RHSA-2026:1541
https://access.redhat.com/errata/RHSA-2026:3461
https://access.redhat.com/errata/RHSA-2026:3462
https://access.redhat.com/security/cve/CVE-2025-5318 Third Party Advisory
https://bugzilla.redhat.com/show_bug.cgi?id=2369131 Issue Tracking Third Party Advisory
https://www.libssh.org/security/advisories/CVE-2025-5318.txt Vendor Advisory
cvelogic Threat Intelligence