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

Published May 29, 2025
·
Updated

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 sftphandle 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.

Other sources

Out-of-Bounds Read vulnerability in the SFTP server implementation of libssh, specifically within the sftphandle() function. The flaw is due to an incorrect boundary check that permits the function to access memory beyond the valid handle list. This leads to the return of an invalid pointer, which is subsequently used in further processing. Although the issue requires authenticated access to the server, it can be exploited by a remote attacker with valid credentials to potentially read unintended memory regions, which could expose sensitive information or affect service behavior.

Red Hat

Affected Software

10 affected components
libssh libssh
redhat OpenShift Container Platform=4.0
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
redhat Enterprise Linux=10.0
libssh libssh<0.11.2
IBM Verify Identity Access<=11.0 - 11.0.2
IBM Security Verify Access<=10.0 - 10.0.9.1
IBM Verify Identity Access Container<=11.0 - 11.0.2
IBM Security Verify Access Container<=10.0 - 10.0.9.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade libssh to a version that resolves this vulnerability.

    Fixed in 0.11.2
  2. Compensating control

    Because exploitation requires authenticated access with valid credentials, restrict/limit SFTP/libssh server access to only necessary users and networks (e.g., via firewall/ACL) to reduce the likelihood of authenticated remote exploitation.

Event History

May 29, 2025
Data Sourced
via Red Hat·07:05 AM
DescriptionSeverityAffected Software
Jun 24, 2025
CVE Published
via MITRE·02:10 PM
Data Sourced
via MITRE·02:10 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:15 PM
DescriptionSeverityWeaknessAffected Software
Jul 8, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-5318?

CVE-2025-5318 has been classified as a medium severity vulnerability due to the potential for out-of-bounds memory access.

2

How do I fix CVE-2025-5318?

To fix CVE-2025-5318, update the libssh library to the latest version that addresses this vulnerability.

3

What causes CVE-2025-5318?

CVE-2025-5318 is caused by an incorrect comparison check in the sftp_handle function of the libssh library.

4

Which software is affected by CVE-2025-5318?

CVE-2025-5318 affects the libssh library, specifically versions that have not been patched.

5

What are the potential impacts of CVE-2025-5318?

The potential impacts of CVE-2025-5318 include random crashes and possible exposure of sensitive data due to out-of-bounds reads.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203