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.
Security readout for executives and security teams
Plain-English summary
CVE-2025-5318 is a high-severity memory-read flaw in libssh SFTP handling. An already authenticated remote user may cause libssh to read beyond a valid handle list, potentially exposing sensitive memory or disrupting service behavior. Treat this as urgent where SSH/SFTP access is offered to many users or less-trusted accounts.
Executive priority
Prioritize patching in the next normal security maintenance window, faster for shared or externally reachable SFTP services. The bug is high severity because it may expose memory, but current provided evidence does not support emergency active-exploitation handling.
Technical view
The flaw is a CWE-125 out-of-bounds read in libssh sftp_handle(). An incorrect comparison can allow access beyond the valid handle list and return an invalid pointer for later processing. Sources describe affected libssh versions below 0.11.2 and multiple Red Hat Enterprise Linux 8, 9, and 10 libssh package streams.
Likely exposure
Most likely exposure is Linux systems or applications using affected libssh packages, especially the listed Red Hat Enterprise Linux 8, 9, 10, EUS, AUS, TUS, and SAP streams. Exposure requires an authenticated remote attacker, so shared SFTP or SSH-enabled environments deserve priority.
Exploitation context
The source bundle does not show CISA KEV listing or cited evidence of active exploitation. Exploitation requires network reachability and valid authentication. The realistic concern is post-authentication information disclosure or service instability in systems using vulnerable libssh SFTP functionality.
Researcher notes
Focus analysis on sftp_handle() bounds validation and downstream use of the returned pointer. Avoid assuming all SSH services are affected; confirm libssh usage and SFTP code paths. The provided evidence is strong for affected Red Hat package streams but incomplete for other vendors.
Mitigation direction
Apply applicable Red Hat RHSA updates for affected RHEL streams.
Upgrade libssh to a vendor-fixed release, where available.
Restrict SSH/SFTP access to trusted users and networks until patched.
Review vendor guidance for non-Red Hat distributions or bundled libssh copies.
Prioritize shared, internet-facing, or partner-accessible SSH/SFTP services.
Validation and detection
Inventory installed libssh package versions across Linux assets.
Compare RHEL systems against the affected package versions listed in the CVE bundle.
Identify applications dynamically or statically linked to libssh.
Confirm whether those applications expose SSH or SFTP to authenticated remote users.
Verify patch status through vendor package metadata or advisory tooling.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-125: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The affected technology mentions containers, so container-specific ATT&CK technique review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
5Timeline events
1ADP providers
31Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-125 · source CWE mapping
Out-of-bounds Read
Out-of-bounds Read represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.